/* =====================================================================
   GWENT — thème spatial sobre
   ===================================================================== */
:root {
  --void: #04060d;
  --hull: #0c1224;
  --hull2: #121a33;
  --line: #22304f;
  --line2: #33466f;
  --ink: #e4e9f5;
  --mute: #8390ad;
  --red: #e3202b;
  --red-soft: rgba(227, 32, 43, .35);
  --violet: #7d59f2;
  --violet-soft: rgba(125, 89, 242, .38);
  --gold: #d9ae52;
  --cyan: #62e2ff;
  --ok: #52e39a;
  --bad: #ff5a64;
  --ui: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --card-title: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --display: 'Orbitron', 'Chakra Petch', system-ui, sans-serif;
  --card-text: 'Alegreya', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--void); color: var(--ink); font-family: var(--ui); overflow: hidden; user-select: none; -webkit-user-select: none; }
button { font-family: inherit; }
#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }

#stage {
  position: absolute; left: 50%; top: 50%; width: 1600px; height: 900px;
  transform-origin: 0 0; z-index: 1;
}
.screen { position: absolute; inset: 0; display: none; }
.screen.on { display: block; }

/* ---------- boutons ---------- */
.btn {
  appearance: none; border: 1px solid var(--line2); background: linear-gradient(180deg, #17213d, #0e1528);
  color: var(--ink); padding: 10px 20px; border-radius: 6px; font-size: 15px; font-weight: 600; letter-spacing: .02em;
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s, opacity .15s;
}
.btn:hover:not(:disabled) { border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(98,226,255,.25), 0 0 18px rgba(98,226,255,.15); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn:focus-visible, .tool:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn-primary { background: linear-gradient(180deg, #2a4c7a, #183155); border-color: #4b7fc0; }
.btn-primary.on { background: linear-gradient(180deg, #1f6b4c, #134a34); border-color: var(--ok); }
.btn-lg { font-size: 20px; padding: 16px 38px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.tool {
  appearance: none; border: 1px solid var(--line2); background: rgba(12,18,36,.85); color: var(--ink);
  height: 40px; min-width: 40px; border-radius: 8px; cursor: pointer; font-size: 17px; position: relative;
}
.tool:hover { border-color: var(--cyan); }
.tool.muted { opacity: .45; text-decoration: line-through; }

/* ---------- accueil ---------- */
.home-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.home-versos { position: relative; width: 470px; height: 300px; margin-bottom: -10px; }
.hv { position: absolute; width: 190px; top: 10px; border-radius: 12px; box-shadow: 0 30px 60px rgba(0,0,0,.7); }
.hv-l { left: 0; transform: rotate(-9deg); animation: floatL 6s ease-in-out infinite; }
.hv-r { right: 0; transform: rotate(9deg); animation: floatR 6s ease-in-out infinite; }
@keyframes floatL { 50% { transform: rotate(-11deg) translateY(-8px); } }
@keyframes floatR { 50% { transform: rotate(11deg) translateY(-8px); } }
.logo {
  position: relative; margin: 0; font-family: var(--display); font-weight: 900; font-size: 108px; letter-spacing: .22em; line-height: 1;
  text-indent: .22em;
  background: linear-gradient(100deg, #ff4b53 0%, #ffd9dc 26%, #f4f7ff 50%, #cfc0ff 74%, #7d59f2 100%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: logoShine 9s ease-in-out infinite;
  filter: drop-shadow(0 0 26px rgba(160,190,255,.18));
}
.logo::after {
  content: ''; position: absolute; left: 8%; right: 8%; bottom: -14px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(98,226,255,.75), transparent);
  box-shadow: 0 0 14px rgba(98,226,255,.5);
}
@keyframes logoShine { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.btn-collection { border-color: var(--gold); color: #ffe4a3; background: linear-gradient(180deg, #2b2416, #15120a); }
.btn-collection:hover:not(:disabled) { border-color: #ffd98a; box-shadow: 0 0 0 1px rgba(217,174,82,.3), 0 0 22px rgba(217,174,82,.25); }
.tagline { margin: 0; color: var(--mute); font-size: 18px; }
.home-msg { color: var(--bad); min-height: 22px; margin: 0; }

/* ---------- lobby ---------- */
.scr-title { text-align: center; font-weight: 600; font-size: 30px; margin: 60px 0 16px; }
.share { display: flex; gap: 10px; justify-content: center; align-items: center; color: var(--mute); }
.share input { width: 460px; background: #070b17; border: 1px solid var(--line2); color: var(--cyan); padding: 10px 12px; border-radius: 6px; font-family: var(--ui); font-size: 15px; }
.lobby-grid { display: flex; justify-content: center; align-items: center; gap: 40px; margin-top: 40px; }
.lobby-card {
  width: 470px; min-height: 520px; background: linear-gradient(180deg, rgba(18,26,51,.92), rgba(9,13,27,.92));
  border: 1px solid var(--line); border-radius: 14px; padding: 26px 30px; display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.lc-head { color: var(--mute); font-size: 14px; letter-spacing: .08em; }
.lc-avatar { width: 108px; height: 108px; border-radius: 50%; display: grid; place-items: center; font-size: 58px; background: radial-gradient(circle at 35% 30%, #25345e, #0a1022); border: 2px solid var(--line2); }
.lc-name { font-size: 26px; font-weight: 600; }
.lc-status { color: var(--mute); }
.lc-status.ok { color: var(--ok); }
.field { display: flex; flex-direction: column; gap: 6px; width: 100%; color: var(--mute); font-size: 13px; }
.field input { background: #070b17; border: 1px solid var(--line2); color: var(--ink); padding: 11px 12px; font-size: 18px; border-radius: 6px; font-family: var(--ui); }
.field input:focus { outline: none; border-color: var(--cyan); }
.avatars { display: grid; grid-template-columns: repeat(8, 44px); gap: 7px; }
.av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 23px; cursor: pointer; background: #0a1022; border: 1px solid var(--line); transition: transform .12s, border-color .12s; }
.av:hover { transform: scale(1.1); }
.av.sel { border-color: var(--cyan); box-shadow: 0 0 12px rgba(98,226,255,.45); }
.vs { font-family: var(--card-title); font-size: 46px; color: var(--mute); }

/* ---------- construction du deck ---------- */
.deck-top { position: absolute; left: 0; right: 0; top: 0; height: 104px; display: flex; align-items: center; gap: 22px; padding: 0 28px;
  background: linear-gradient(180deg, rgba(10,15,30,.96), rgba(10,15,30,.75)); border-bottom: 1px solid var(--line); }
.deck-emblem { width: 58px; border-radius: 6px; }
.deck-fac { font-family: var(--card-title); font-size: 30px; font-weight: 800; letter-spacing: .12em; }
.deck-fac.red { color: #ff4b53; } .deck-fac.blue { color: #a28bff; }
.deck-hint { color: var(--mute); font-size: 13px; margin-top: 2px; }
.deck-stats { display: flex; gap: 18px; margin-left: auto; }
.stat { text-align: center; min-width: 64px; }
.stat b { display: block; font-size: 24px; font-weight: 700; }
.stat span { color: var(--mute); font-size: 12px; }
.stat.warn b { color: var(--bad); } .stat.good b { color: var(--ok); }
.deck-actions { display: flex; flex-direction: column; gap: 6px; }
.deck-ready { display: flex; align-items: center; gap: 14px; }
.deck-opp { color: var(--mute); font-size: 13px; text-align: right; max-width: 160px; }
.deck-opp.ok { color: var(--ok); }
.deck-body { position: absolute; top: 104px; left: 0; right: 0; bottom: 0; display: flex; }
.deck-grid { flex: 1; overflow-y: auto; padding: 14px 20px 40px 28px; }
.deck-grid::-webkit-scrollbar { width: 8px; } .deck-grid::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 4px; }
.sec-title { font-size: 17px; font-weight: 600; color: var(--mute); margin: 18px 0 10px; display: flex; gap: 10px; align-items: baseline; }
.sec-title small { font-size: 13px; }
.sec-cards { display: flex; flex-wrap: wrap; gap: 12px; }
.dk { position: relative; width: 118px; cursor: pointer; transition: transform .15s, filter .2s, opacity .2s; }
.dk:hover { transform: translateY(-4px); }
.dk.off { filter: grayscale(1) brightness(.45); opacity: .7; }
.dk.off::after { content: '✕'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 46px; color: rgba(255,90,100,.85); font-weight: 700; pointer-events: none; }
.dk .num { position: absolute; bottom: -4px; right: -4px; background: #070b17; border: 1px solid var(--line2); color: var(--mute); font-size: 10px; padding: 1px 5px; border-radius: 8px; z-index: 5; }
.deck-preview { width: 330px; padding: 24px; border-left: 1px solid var(--line); background: rgba(8,12,24,.6); }
.deck-preview .card { width: 280px; }
.pv-text { margin-top: 14px; color: var(--mute); font-size: 14px; line-height: 1.45; }

/* =====================================================================
   CARTE
   ===================================================================== */
.card {
  position: relative; aspect-ratio: 2 / 3; container-type: inline-size; border-radius: 5.5% / 3.7%;
  flex: none; transform-origin: 50% 50%;
}
.card > * { position: absolute; pointer-events: none; }
.card .c-bg { inset: 0; background-size: 100% 100%; border-radius: inherit; box-shadow: 0 4px 10px rgba(0,0,0,.55); }
.card.f-red .c-bg { background-image: url(assets/card_red.webp); }
.card.f-blue .c-bg { background-image: url(assets/card_blue.webp); }
.card .c-art { left: 9.2%; top: 4.2%; width: 82.2%; height: 58.4%; object-fit: cover; }
.card .c-frame { inset: 0; background-size: 100% 100%; }
.card.f-red .c-frame { background-image: url(assets/frame_red.webp); }
.card.f-blue .c-frame { background-image: url(assets/frame_blue.webp); }
.card .c-str {
  left: 5.6%; top: 3.7%; width: 17.9%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--card-title); font-weight: 800; font-size: 11.5cqw; color: #1a1512; line-height: 1;
  background: radial-gradient(circle at 40% 35%, #f8f1e2, #ddd1b8 70%, #c9b995);
  transition: color .3s;
}
.card .c-str.buff { color: #0e8a45; }
.card .c-str.nerf { color: #c3141f; }
.card.hero .c-str { background: radial-gradient(circle at 40% 35%, #3a3a44, #121217 72%); color: #fff; text-shadow: 0 0 6px rgba(255,255,255,.6); }
.card.special .c-str { font-size: 10cqw; }
.card .c-str .ico { width: 70%; height: 70%; background: #1a1512; -webkit-mask: var(--ico) center/contain no-repeat; mask: var(--ico) center/contain no-repeat; }
.card .c-row { left: 4.3%; top: 23.9%; width: 13.2%; aspect-ratio: 1; display: grid; place-items: center; }
.card .c-row { color: #141010; }
.card .c-row svg { width: 62%; height: 62%; }
.card .c-row .sg { font-size: 8cqw; line-height: 1; color: #f4ecdc; text-shadow: 0 0 4px rgba(0,0,0,.6); }
.card .c-abil {
  left: 4.9%; top: 33.8%; width: 12%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f5efe3, #cfc4ab); box-shadow: 0 0 0 .9cqw #a8763c, 0 0 0 1.4cqw #2a1c10;
  display: grid; place-items: center;
}
.card .c-abil i { width: 78%; height: 78%; background: #141010; -webkit-mask: var(--ico) center/contain no-repeat; mask: var(--ico) center/contain no-repeat; }
.card .c-name {
  left: 12%; right: 12%; top: 64.2%; height: 6.8%; display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--card-title); font-weight: 700; font-size: max(5.2cqw, 7px); color: #1d1814; line-height: 1.05; letter-spacing: .02em;
  text-transform: uppercase; overflow: hidden;
}
.card .c-desc {
  left: 12%; right: 12%; top: 76%; height: 13.5%; display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--card-text); font-size: 4.5cqw; line-height: 1.22; color: #2a221b;
}
.card .c-desc b { font-weight: 700; }
@container (max-width: 180px) { .c-desc { display: none !important; } }
@container (max-width: 96px) {
  .c-name, .c-row { display: none !important; }
  .c-str { width: 36% !important; font-size: 23cqw !important; left: 3% !important; top: 2% !important; box-shadow: 0 0 0 1.8cqw #a8763c, 0 0 0 3cqw #2a1c10; }
  .c-abil { left: auto !important; right: 4% !important; top: auto !important; bottom: 3% !important; width: 26% !important; }
}

/* ----- hologramme des héros ----- */
.card .c-holo { inset: 0; border-radius: inherit; overflow: hidden; display: none; mix-blend-mode: color-dodge; opacity: .32; transition: opacity .25s; }
.card.hero:hover .c-holo { opacity: .6; }
.card.hero .c-holo { display: block; }
.card .c-holo::before {
  content: ''; position: absolute; inset: -50%;
  background:
    repeating-linear-gradient(110deg, rgba(255,0,140,.0) 0%, rgba(255,0,140,.55) 5%, rgba(255,230,0,.5) 10%, rgba(0,255,160,.5) 15%, rgba(0,190,255,.55) 20%, rgba(170,0,255,.5) 25%, rgba(255,0,140,.0) 30%);
  background-size: 200% 200%;
  animation: holo 6s linear infinite;
  transform: translate(calc(var(--mx, 0) * 12%), calc(var(--my, 0) * 12%));
}
.card .c-holo::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 20% 30%, #fff 0 .6px, transparent 1.2px), radial-gradient(circle at 70% 60%, #fff 0 .6px, transparent 1.2px), radial-gradient(circle at 40% 80%, #fff 0 .5px, transparent 1px);
  background-size: 9% 6%, 13% 9%, 17% 11%; opacity: .7; animation: sparkle 2.4s ease-in-out infinite alternate;
}
@keyframes holo { to { background-position: 200% 0; } }
@keyframes sparkle { from { opacity: .25; } to { opacity: .8; } }
.card.hero { box-shadow: 0 0 14px rgba(255, 220, 140, .25); }
.card.tilt { transition: transform .12s ease-out; }

/* ----- animations de force ----- */
.card .c-str.pop { animation: strPop .7s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes strPop { 0% { transform: scale(1); } 35% { transform: scale(1.55); } 100% { transform: scale(1); } }
.float-num {
  position: absolute; z-index: 60; font-family: var(--ui); font-weight: 700; font-size: 20px; pointer-events: none;
  text-shadow: 0 2px 6px #000, 0 0 12px currentColor; animation: floatUp 1.3s ease-out forwards;
}
.float-num.up { color: var(--ok); } .float-num.down { color: var(--bad); }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 0) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -10px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -48px) scale(1); } }
.card.flash::after { content: ''; position: absolute; inset: -3px; border-radius: inherit; box-shadow: 0 0 0 2px var(--fc, #fff), 0 0 24px var(--fc, #fff); animation: flash .8s ease-out forwards; pointer-events: none; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

/* =====================================================================
   PLATEAU
   ===================================================================== */
#scr-game { }
.side-col { position: absolute; left: 18px; top: 0; width: 286px; height: 900px; }
.panel {
  position: absolute; left: 0; width: 286px; height: 148px; border-radius: 12px; padding: 14px 14px 12px 102px;
  background: linear-gradient(135deg, rgba(20,29,56,.94), rgba(10,15,30,.94)); border: 1px solid var(--line);
  transition: box-shadow .3s, border-color .3s;
}
.panel.opp { top: 106px; } .panel.me { top: 452px; }
.panel.active { border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(98,226,255,.3), 0 0 28px rgba(98,226,255,.18); }
.panel .p-av { position: absolute; left: 12px; top: 20px; width: 78px; height: 78px; }
.panel .p-av .face { position: absolute; inset: 7px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; background: radial-gradient(circle at 35% 30%, #25345e, #0a1022); }
.panel .p-av svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.panel .p-av .ring-bg { stroke: rgba(255,255,255,.08); }
.panel .p-av .ring { stroke: var(--cyan); transition: stroke .3s; stroke-linecap: round; }
.panel .p-av .ring.low { stroke: var(--bad); }
.panel .p-timer { position: absolute; left: 12px; top: 102px; width: 78px; text-align: center; font-size: 14px; font-weight: 700; color: var(--cyan); }
.panel .p-timer.low { color: var(--bad); animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.panel .p-name { font-size: 19px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.panel .p-fac { font-size: 12px; letter-spacing: .1em; margin-top: 1px; }
.panel .p-fac.red { color: #ff5c63; } .panel .p-fac.blue { color: #a58fff; }
.panel .p-meta { display: flex; gap: 12px; margin-top: 12px; align-items: center; color: var(--mute); font-size: 14px; }
.panel .gems { display: flex; gap: 6px; }
.gem { width: 18px; height: 18px; transform: rotate(45deg); border: 1px solid #5a6a8c; background: #0b1020; transition: all .5s; }
.gem.on { background: linear-gradient(135deg, #ff9aa0, var(--red)); border-color: #ffb3b8; box-shadow: 0 0 10px var(--red); }
.panel.blue .gem.on { background: linear-gradient(135deg, #c9b8ff, var(--violet)); border-color: #d4c7ff; box-shadow: 0 0 10px var(--violet); }
.gem.lost { animation: gemBreak .9s ease-out; }
@keyframes gemBreak { 30% { transform: rotate(45deg) scale(1.6); filter: brightness(3); } 100% { transform: rotate(45deg) scale(1); } }
.panel .hc::before { content: ''; display: inline-block; width: 11px; height: 15px; border: 1.5px solid var(--mute); border-radius: 2px; margin-right: 5px; vertical-align: -2px; }
.panel .p-passed { position: absolute; right: 12px; bottom: 10px; font-size: 12px; font-weight: 700; color: var(--gold); border: 1px solid var(--gold); padding: 2px 8px; border-radius: 10px; display: none; }
.panel.passed .p-passed { display: block; }
.panel .p-total {
  position: absolute; right: -22px; top: 50%; transform: translateY(-50%); width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; font-size: 25px; font-weight: 700; background: radial-gradient(circle at 40% 35%, #1d2a50, #0a0f20);
  border: 2px solid var(--line2); z-index: 3;
}
.panel .p-total.lead { border-color: var(--gold); color: #ffe4a3; box-shadow: 0 0 18px rgba(217,174,82,.45); }
.panel .p-total.pop, .row-score.pop { animation: scorePop .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes scorePop { 40% { transform: translateY(-50%) scale(1.35); } }
.row-score.pop { animation-name: rowPop; }
@keyframes rowPop { 40% { transform: scale(1.35); } }
.emote-bubble { position: absolute; left: 60px; top: -30px; background: #f2f5ff; color: #111; padding: 6px 12px; border-radius: 14px; font-size: 15px; font-weight: 600; white-space: nowrap; z-index: 10; animation: bubble 2.6s ease forwards; }
@keyframes bubble { 0% { opacity: 0; transform: translateY(8px) scale(.7); } 10% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }

.weather-zone {
  position: absolute; top: 290px; left: 0; width: 286px; height: 132px; border-radius: 12px;
  background: rgba(8,12,26,.72); border: 1px dashed var(--line2); display: flex; align-items: center; justify-content: center;
}
.wz-label { position: absolute; top: 6px; left: 12px; font-size: 12px; color: var(--mute); }
.wz-cards { display: flex; gap: 6px; }
.wz-cards .card { width: 70px; }
.turn-box { position: absolute; top: 626px; left: 0; width: 286px; display: flex; flex-direction: column; gap: 10px; }
.btn-pass { width: 100%; padding: 14px; font-size: 17px; }
.btn-pass.confirm { border-color: var(--gold); color: #ffe4a3; box-shadow: 0 0 18px rgba(217,174,82,.3); }

.board { position: absolute; left: 326px; top: 10px; width: 966px; height: 692px; }
.half { position: absolute; left: 0; right: 0; height: 336px; display: flex; flex-direction: column; gap: 4px; }
.half.opp { top: 0; flex-direction: column-reverse; }
.half.me { bottom: 0; }
.divider { position: absolute; left: 0; right: 0; top: 338px; height: 16px; display: flex; align-items: center; justify-content: center; }
.divider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, var(--line2) 20%, var(--line2) 80%, transparent); }
.divider span { position: relative; background: var(--void); padding: 0 14px; font-size: 12px; color: var(--mute); letter-spacing: .12em; }
.row {
  position: relative; height: 109px; border-radius: 10px; display: flex; align-items: center;
  background: linear-gradient(90deg, rgba(16,24,48,.78), rgba(10,15,32,.6)); border: 1px solid rgba(51,70,111,.55);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.half.me .row.f-red { border-left: 3px solid var(--red-soft); } .half.me .row.f-blue { border-left: 3px solid var(--violet-soft); }
.half.opp .row.f-red { border-left: 3px solid var(--red-soft); } .half.opp .row.f-blue { border-left: 3px solid var(--violet-soft); }
.row .row-num {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: var(--card-title); font-weight: 800; font-size: 110px;
  color: #fff; opacity: .05; pointer-events: none; line-height: 1;
}
.row .row-score {
  flex: none; width: 44px; height: 44px; margin: 0 8px 0 10px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 19px;
  background: radial-gradient(circle at 40% 35%, #213058, #0b1122); border: 1px solid var(--line2); position: relative; z-index: 2;
}
.row .horn-slot {
  flex: none; width: 66px; height: 97px; border-radius: 6px; border: 1px dashed rgba(98,120,170,.35); display: grid; place-items: center; position: relative; z-index: 2;
}
.row .horn-slot::before { content: ''; position: absolute; width: 26px; height: 26px; background: rgba(140,160,200,.22); -webkit-mask: url(assets/icons/horn.png) center/contain no-repeat; mask: url(assets/icons/horn.png) center/contain no-repeat; }
.row .horn-slot.has::before { display: none; }
.row .horn-slot .card { width: 64px; }
.row.horn-on .row-score { border-color: var(--gold); box-shadow: 0 0 10px rgba(217,174,82,.4); }
.row .units { flex: 1; height: 100%; display: flex; align-items: center; justify-content: center; padding: 0 8px; position: relative; z-index: 2; }
.row .units .card { width: 64px; margin: 0 2px; }
.row .units .card:hover, .hand .card:hover { z-index: 20; }
.row .units .card:hover { transform: translateY(-6px) scale(1.08); transition: transform .12s; }
.row .row-icon { position: absolute; right: 10px; top: 8px; width: 16px; height: 16px; opacity: .3; z-index: 1; }
.row .row-icon svg { width: 100%; height: 100%; fill: #c9d4ee; }

/* drop zones */
.drop-ok { border-color: rgba(98,226,255,.75) !important; box-shadow: inset 0 0 22px rgba(98,226,255,.14), 0 0 14px rgba(98,226,255,.2) !important; }
.drop-hover { background: rgba(98,226,255,.12) !important; box-shadow: inset 0 0 36px rgba(98,226,255,.35), 0 0 24px rgba(98,226,255,.45) !important; }
.card.drop-ok { outline: 2px solid var(--cyan); outline-offset: 2px; }
.card.drop-hover { outline: 3px solid #fff; }
.weather-zone.drop-ok { border-style: solid; }

/* météo sur les lignes */
.row .wx { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .6s; z-index: 3; overflow: hidden; }
.row .wx i { position: absolute; display: block; pointer-events: none; }
.row.w-frost .wx.frost, .row.w-fog .wx.fog, .row.w-rain .wx.rain { opacity: 1; }
.row.w-frost, .row.w-fog, .row.w-rain { border-color: rgba(120,170,230,.55); }

/* --- givre --- */
.wx.frost { background: linear-gradient(90deg, rgba(150,215,255,.24), rgba(150,215,255,.05) 45%, rgba(150,215,255,.2)); box-shadow: inset 0 0 34px rgba(170,225,255,.42); }
.wx.frost::before {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(200,240,255,.42), transparent 22%),
    linear-gradient(0deg, rgba(200,240,255,.38), transparent 20%),
    radial-gradient(circle at 0 0, rgba(230,250,255,.6), transparent 26%),
    radial-gradient(circle at 100% 100%, rgba(230,250,255,.6), transparent 26%);
  mix-blend-mode: screen; animation: frostBreathe 5s ease-in-out infinite;
}
@keyframes frostBreathe { 50% { opacity: .72; } }
.wx.frost::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.75) 0 1px, transparent 1.6px);
  background-size: 23px 19px; animation: frostDrift 12s linear infinite; opacity: .5;
}
@keyframes frostDrift { to { background-position: 230px 190px; } }
.wx.frost .l1 {
  inset: -30px 0 0 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.95) 0 1.7px, transparent 2.2px), radial-gradient(circle, rgba(215,245,255,.7) 0 1.1px, transparent 1.7px);
  background-size: 96px 64px, 57px 41px; animation: snowFall 5.5s linear infinite;
}
.wx.frost .l2 {
  inset: -30px 0 0 0; opacity: .6;
  background-image: radial-gradient(circle, rgba(255,255,255,.8) 0 1.3px, transparent 1.8px);
  background-size: 73px 52px; animation: snowFall 8.5s linear infinite;
}
@keyframes snowFall { to { transform: translateY(96px); } }

/* --- brume --- */
.wx.fog { background: linear-gradient(90deg, rgba(196,206,222,.07), rgba(196,206,222,.12), rgba(196,206,222,.05)); }
.wx.fog::before, .wx.fog::after, .wx.fog .l1, .wx.fog .l2 {
  content: ''; position: absolute; top: -40%; bottom: -40%; width: 72%;
  background: radial-gradient(ellipse at center, rgba(228,236,250,.16), transparent 70%);
  mix-blend-mode: screen; filter: blur(6px);
  animation: fogMove 9s ease-in-out infinite alternate;
}
.wx.fog::after { animation-duration: 13s; animation-direction: alternate-reverse; left: 38%; opacity: .85; }
.wx.fog .l1 { left: 12%; width: 55%; animation-duration: 16s; opacity: .6; }
.wx.fog .l2 { left: 62%; width: 48%; animation-duration: 11s; animation-direction: alternate-reverse; opacity: .5; }
@keyframes fogMove { from { transform: translateX(-32%) scale(1); } to { transform: translateX(58%) scale(1.15); } }

/* --- pluie --- */
.wx.rain { background: linear-gradient(180deg, rgba(48,88,160,.24), rgba(35,62,120,.12)); }
.wx.rain::before {
  content: ''; position: absolute; inset: -40px 0 0 0;
  background: repeating-linear-gradient(105deg, transparent 0 14px, rgba(160,200,255,.4) 14px 15px);
  animation: rainFall .45s linear infinite;
}
.wx.rain .l1 {
  inset: -40px 0 0 0; opacity: .55;
  background: repeating-linear-gradient(100deg, transparent 0 25px, rgba(190,220,255,.5) 25px 26.5px);
  animation: rainFall .72s linear infinite;
}
.wx.rain .l2 {
  left: 0; right: 0; bottom: 0; height: 12px;
  background: repeating-linear-gradient(90deg, rgba(190,225,255,.5) 0 2px, transparent 2px 26px);
  filter: blur(1px); animation: rainSplash .8s steps(3) infinite;
}
@keyframes rainFall { to { transform: translateY(44px); } }
@keyframes rainSplash { 0%, 100% { opacity: .15; } 50% { opacity: .5; transform: translateX(7px); } }

/* --- dissipation par Temps dégagé --- */
.row .wx.wx-ghost { opacity: 1; z-index: 4; animation: wxAway 1.15s cubic-bezier(.3,0,.25,1) forwards; }
@keyframes wxAway {
  0% { opacity: 1; }
  30% { opacity: .95; filter: brightness(1.9) saturate(.5); }
  100% { opacity: 0; filter: brightness(2.6) blur(11px); transform: translateY(-18px) scale(1.08); }
}
.wx-sun { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; z-index: 5; }
.wx-sun::before {
  content: ''; position: absolute; top: -60%; bottom: -60%; left: -60%; width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255,232,160,.7) 35%, rgba(255,255,255,.95) 50%, rgba(255,232,160,.6) 65%, transparent);
  filter: blur(5px); transform: rotate(8deg); animation: sunSweep 1.1s cubic-bezier(.35,0,.2,1) forwards;
}
@keyframes sunSweep { to { left: 118%; } }
.wx-sun::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,226,150,.4), transparent 70%);
  animation: sunGlow 1.2s ease-out forwards;
}
@keyframes sunGlow { 0% { opacity: 0; } 22% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- main ---------- */
.hand {
  position: absolute; left: 326px; top: 716px; width: 966px; height: 176px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: rgba(8,12,26,.55); border: 1px solid rgba(51,70,111,.4); z-index: 4;
}
.hand .card { width: 106px; cursor: grab; transition: transform .16s ease, box-shadow .16s ease; }
.hand .card:hover { transform: translateY(-16px) scale(1.06); }
.hand .card.selected { transform: translateY(-26px) scale(1.1); box-shadow: 0 0 0 2px var(--cyan), 0 0 26px rgba(98,226,255,.55); z-index: 25; }
.hand .card.ghosted { opacity: .25; }
.hand.locked .card { cursor: default; }

/* ---------- colonne droite ---------- */
.right-col { position: absolute; left: 1312px; top: 0; width: 270px; height: 900px; }
.piles { position: absolute; left: 0; width: 270px; height: 140px; display: flex; gap: 14px; justify-content: center; }
#piles-1 { top: 14px; } #piles-0 { top: 646px; }
.pile { position: relative; width: 88px; height: 132px; cursor: pointer; }
.pile .lbl { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--mute); }
.pile .deckstack { position: absolute; inset: 0; background-size: cover; border-radius: 6px; box-shadow: 2px 2px 0 #000, 4px 4px 0 #111, 6px 6px 0 #000, 0 10px 22px rgba(0,0,0,.6); }
.pile .deckstack.red { background-image: url(assets/verso_red.webp); } .pile .deckstack.blue { background-image: url(assets/verso_blue.webp); }
.pile .count { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(4,6,13,.8); border: 1px solid var(--line2); padding: 3px 10px; border-radius: 12px; font-weight: 700; font-size: 16px; z-index: 3; }
.pile .discard-slot { position: absolute; inset: 0; border: 1px dashed var(--line2); border-radius: 6px; }
.pile .discard-slot .card { width: 88px; position: absolute; top: 0; left: 0; }
.preview { position: absolute; top: 176px; left: 0; width: 270px; height: 450px; display: flex; flex-direction: column; align-items: center; }
.preview .card { width: 250px; }
.pv-empty { margin-top: 170px; color: var(--mute); font-size: 13px; text-align: center; opacity: .6; }
.pv-why { margin-top: 8px; font-size: 12.5px; color: var(--mute); text-align: center; line-height: 1.35; }
.tools { position: absolute; top: 838px; right: 0; display: flex; gap: 8px; }
.tool-log { padding: 0 18px; font-weight: 700; letter-spacing: .1em; font-size: 15px; }
.badge { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); font-size: 11px; display: none; place-items: center; padding: 0 4px; letter-spacing: 0; }
.badge.on { display: grid; }
.emotes { position: relative; }
.emote-list { position: absolute; bottom: 48px; right: 0; display: none; flex-direction: column; gap: 4px; background: rgba(8,12,26,.96); border: 1px solid var(--line2); border-radius: 10px; padding: 6px; }
.emote-list.on { display: flex; }
.emote-list button { white-space: nowrap; text-align: left; background: none; border: 0; color: var(--ink); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.emote-list button:hover { background: rgba(98,226,255,.12); }

/* ---------- aides ---------- */
.hint { position: absolute; left: 326px; width: 966px; top: 690px; text-align: center; font-size: 13px; color: var(--cyan); pointer-events: none; opacity: 0; transition: opacity .2s; z-index: 5; }
.hint.on { opacity: 1; }
.banner {
  position: absolute; left: 326px; width: 966px; top: 312px; height: 76px; display: grid; place-items: center; z-index: 40; pointer-events: none;
  font-size: 34px; font-weight: 700; letter-spacing: .06em; opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(8,14,32,.92) 20%, rgba(8,14,32,.92) 80%, transparent);
}
.banner.show { animation: banner 1.7s ease forwards; }
.banner.me { color: var(--cyan); } .banner.opp { color: var(--mute); }
@keyframes banner { 0% { opacity: 0; transform: scaleY(.3); } 15% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- superpositions ---------- */
.overlay { position: absolute; inset: 0; z-index: 70; display: none; place-items: center; background: rgba(3,5,12,.72); backdrop-filter: blur(3px); }
.overlay.on { display: grid; }
.overlay.see-hand { background: rgba(3,5,12,.6); }
.dialog { background: linear-gradient(180deg, rgba(18,26,51,.97), rgba(8,12,26,.97)); border: 1px solid var(--line2); border-radius: 16px; padding: 30px 40px; text-align: center; min-width: 460px; max-width: 1200px; }
.dialog h3 { margin: 0 0 8px; font-size: 34px; }
.dialog p { color: var(--mute); margin: 6px 0; }
.dialog .row-btns { display: flex; gap: 14px; justify-content: center; margin-top: 24px; }
.dlg-cards { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; max-height: 560px; overflow-y: auto; padding: 8px; }
.dlg-cards .card { width: 118px; cursor: pointer; transition: transform .15s; }
.dlg-cards .card:hover { transform: translateY(-6px) scale(1.04); }
.mull-bar { position: absolute; left: 326px; width: 966px; top: 470px; text-align: center; z-index: 75; display: none; }
.mull-bar.on { display: block; }
.mull-bar h3 { font-size: 30px; margin: 0; }
.mull-bar p { color: var(--mute); margin: 6px 0 14px; }
.phase-mulligan .hand { z-index: 76; background: rgba(8,12,26,.9); border-color: var(--cyan); }
.phase-mulligan .hand .card { cursor: pointer; }
.phase-mulligan .hand .card:hover { box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(217,174,82,.5); }

.coin { width: 170px; height: 170px; margin: 10px auto 18px; position: relative; transform-style: preserve-3d; animation: coinFlip 2.2s cubic-bezier(.3,.1,.2,1) forwards; }
.coin .face { position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; background-size: cover; background-position: center; border: 4px solid var(--gold); box-shadow: 0 0 30px rgba(217,174,82,.35); }
.coin .back { transform: rotateY(180deg); }
@keyframes coinFlip { from { transform: rotateY(0) scale(.6); } to { transform: rotateY(var(--turns)) scale(1); } }
.res-table { margin: 18px auto 0; border-collapse: collapse; font-size: 17px; }
.res-table td, .res-table th { padding: 7px 18px; border-bottom: 1px solid var(--line); }
.res-table th { color: var(--mute); font-weight: 500; font-size: 13px; }
.res-table .w { color: var(--gold); font-weight: 700; }
.countdown { font-size: 54px; font-weight: 700; color: var(--cyan); margin-top: 8px; }
.big-title { font-family: var(--card-title); font-size: 60px !important; letter-spacing: .1em; }
.big-title.win { color: #ffe09a; text-shadow: 0 0 30px rgba(217,174,82,.6); }
.big-title.lose { color: #ff7b83; }

/* ---------- journal ---------- */
.log-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: 520px; z-index: 90; transform: translateX(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
  background: rgba(6,10,22,.97); border-left: 1px solid var(--line2); display: flex; flex-direction: column;
}
.log-panel.on { transform: none; }
.log-panel header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); font-size: 18px; font-weight: 600; }
.log-list { flex: 1; overflow-y: auto; padding: 10px 18px 30px; font-size: 13.5px; line-height: 1.45; user-select: text; -webkit-user-select: text; }
.log-list::-webkit-scrollbar { width: 8px; } .log-list::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 4px; }
.le { padding: 5px 0; border-bottom: 1px solid rgba(34,48,79,.45); white-space: pre-line; display: flex; gap: 10px; }
.le time { color: #56627f; font-size: 11px; flex: none; padding-top: 2px; font-variant-numeric: tabular-nums; }
.le.head { color: var(--gold); font-weight: 700; border-bottom-color: rgba(217,174,82,.3); padding-top: 12px; }
.le.sys { color: var(--mute); }
.le.play { color: var(--ink); }
.le.diff { color: #b9c7e6; font-size: 12.5px; }
.le.score { color: var(--cyan); font-weight: 600; }
.le.pass { color: #ffcf86; }

/* ---------- effets ---------- */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 80; }
.ghost { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 85; will-change: transform; }
.ghost.dragging { filter: drop-shadow(0 18px 24px rgba(0,0,0,.7)) drop-shadow(0 0 16px rgba(98,226,255,.55)); }
.ring-fx { position: absolute; border-radius: 50%; border: 2px solid var(--c, var(--cyan)); transform: translate(-50%, -50%); animation: ringFx .7s ease-out forwards; pointer-events: none; }
@keyframes ringFx { from { width: 20px; height: 20px; opacity: 1; } to { width: 190px; height: 190px; opacity: 0; } }
.spark { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--c, #fff); box-shadow: 0 0 8px var(--c, #fff); pointer-events: none; animation: spark .8s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
.row-flash { position: absolute; inset: 0; border-radius: 10px; pointer-events: none; animation: rowFlash 1s ease-out forwards; z-index: 4; }
@keyframes rowFlash { from { opacity: 1; } to { opacity: 0; } }
.trail { position: absolute; width: 10px; height: 10px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(140,230,255,.9), transparent 70%); transform: translate(-50%, -50%); animation: trail .5s ease-out forwards; z-index: 84; }
@keyframes trail { to { opacity: 0; transform: translate(-50%, -50%) scale(3); } }

.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px); background: #1b2745; border: 1px solid var(--line2); padding: 10px 18px; border-radius: 8px; opacity: 0; transition: all .25s; z-index: 200; pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%); }
.toast.err { border-color: var(--bad); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   COLLECTION — ouverture de boosters
   ===================================================================== */
#scr-collection { display: none; }
#scr-collection.on { display: block; }
.col-top { position: absolute; left: 0; right: 0; top: 0; height: 84px; display: flex; align-items: center; gap: 22px; padding: 0 28px;
  background: linear-gradient(180deg, rgba(10,15,30,.96), rgba(10,15,30,.6)); border-bottom: 1px solid var(--line); z-index: 4; }
.col-title { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: .18em; }
.col-count { margin-left: auto; color: var(--mute); font-size: 15px; }
.col-bar { position: absolute; left: 0; right: 0; top: 84px; height: 3px; background: rgba(255,255,255,.06); z-index: 4; }
.col-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--gold), var(--violet)); box-shadow: 0 0 12px rgba(217,174,82,.6); transition: width .6s cubic-bezier(.3,1,.4,1); }
.col-stage { position: absolute; left: 0; right: 0; top: 87px; bottom: 74px; display: grid; place-items: center; }
.col-hint { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; color: var(--mute); font-size: 15px; min-height: 22px; }

/* --- le booster --- */
.booster { position: relative; width: 250px; height: 360px; cursor: pointer; transform-style: preserve-3d;
  animation: boosterIn .55s cubic-bezier(.2,1.5,.4,1) both, boosterFloat 5s ease-in-out 0.6s infinite; }
@keyframes boosterIn { from { opacity: 0; transform: translateY(60px) scale(.8) rotate(-8deg); } }
@keyframes boosterFloat { 50% { transform: translateY(-12px) rotate(1deg); } }
.booster .wrap { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; border: 2px solid rgba(255,255,255,.14);
  background-size: cover; background-position: center; box-shadow: 0 34px 70px rgba(0,0,0,.75), inset 0 0 60px rgba(0,0,0,.45); }
.booster .wrap::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 47%, transparent 62%);
  background-size: 260% 100%; animation: packShine 3.4s linear infinite; }
@keyframes packShine { to { background-position: -260% 0; } }
.booster .seam { position: absolute; left: 0; right: 0; top: 26px; height: 16px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.35) 0 6px, transparent 6px 13px); opacity: .55; }
.booster .lbl { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; font-family: var(--display); font-weight: 700; letter-spacing: .18em; font-size: 13px; color: rgba(255,255,255,.82); text-shadow: 0 2px 10px #000; }
.booster .cnt { position: absolute; left: 0; right: 0; top: 60px; text-align: center; font-size: 13px; color: rgba(255,255,255,.75); letter-spacing: .1em; }
.booster.red .wrap { box-shadow: 0 34px 70px rgba(0,0,0,.75), 0 0 46px rgba(227,32,43,.35), inset 0 0 60px rgba(0,0,0,.45); }
.booster.blue .wrap { box-shadow: 0 34px 70px rgba(0,0,0,.75), 0 0 46px rgba(125,89,242,.38), inset 0 0 60px rgba(0,0,0,.45); }
.booster:hover { filter: brightness(1.12); }
.booster.armed { animation: boosterIn .55s cubic-bezier(.2,1.5,.4,1) both, boosterShake .45s ease-in-out infinite; }
@keyframes boosterShake { 0%, 100% { transform: rotate(-2deg) scale(1.03); } 50% { transform: rotate(2deg) scale(1.05); } }
.booster.opening { animation: boosterBurst .6s ease-in forwards; }
@keyframes boosterBurst { 40% { transform: scale(1.12); filter: brightness(2.2); } 100% { transform: scale(1.35); opacity: 0; filter: brightness(3) blur(14px); } }
.burst { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #fff; pointer-events: none;
  box-shadow: 0 0 18px 6px rgba(255,230,170,.8); animation: burstOut .85s ease-out forwards; }
@keyframes burstOut { to { transform: translate(var(--bx), var(--by)) scale(.2); opacity: 0; } }

/* --- cartes révélées --- */
.col-cards { display: flex; gap: 18px; align-items: center; justify-content: center; }
.col-cards .slot { width: 190px; perspective: 1200px; }
.col-cards .card { width: 190px; animation: revealCard .7s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes revealCard {
  0% { opacity: 0; transform: translateY(70px) rotateY(180deg) scale(.6); filter: brightness(2.4); }
  60% { opacity: 1; transform: translateY(-10px) rotateY(0deg) scale(1.06); }
  100% { opacity: 1; transform: none; filter: none; }
}
.col-cards .slot.fresh .card::after {
  content: ''; position: absolute; inset: -6px; border-radius: 12px; border: 2px solid rgba(255,225,150,.9);
  box-shadow: 0 0 26px rgba(255,220,140,.8); animation: newGlow 1.6s ease-out forwards; pointer-events: none;
}
@keyframes newGlow { to { opacity: 0; transform: scale(1.12); } }
.col-cards .slot .tag { text-align: center; margin-top: 10px; font-size: 13px; color: var(--gold); letter-spacing: .06em; height: 18px; }
.col-cards.leaving .card { animation: leaveCard .55s ease-in forwards; }
.col-cards.leaving .slot:nth-child(2) .card { animation-delay: .06s; }
.col-cards.leaving .slot:nth-child(3) .card { animation-delay: .12s; }
.col-cards.leaving .slot:nth-child(4) .card { animation-delay: .18s; }
.col-cards.leaving .slot:nth-child(5) .card { animation-delay: .24s; }
@keyframes leaveCard { to { opacity: 0; transform: translateY(-140px) rotate(14deg) scale(.55); filter: blur(6px) brightness(1.6); } }

/* --- fin de collection --- */
.col-done { text-align: center; animation: boosterIn .6s cubic-bezier(.2,1.4,.4,1) both;
  display: flex; flex-direction: column; align-items: center; max-height: 100%; width: 100%; padding: 8px 0; }
.col-done h3 { font-family: var(--display); font-size: 34px; letter-spacing: .14em; margin: 0 0 10px;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.col-done p { color: var(--mute); margin: 0 0 16px; }
.col-grid { display: grid; grid-template-columns: repeat(15, 76px); gap: 7px; justify-content: center;
  flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px; }
.col-grid .card { width: 76px; }
.col-grid::-webkit-scrollbar { width: 8px; }
.col-grid::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 4px; }

.col-done .row-btns { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }

/* =====================================================================
   MODE SOLO + CONTRÔLES AUDIO
   ===================================================================== */
.btn-solo { border-color: var(--cyan); color: #bdf2ff; background: linear-gradient(180deg, #13303a, #0a1820); }
.btn-solo:hover:not(:disabled), .btn-solo.on { border-color: #7fe6ff; box-shadow: 0 0 0 1px rgba(98,226,255,.3), 0 0 22px rgba(98,226,255,.25); }
.solo-pick { display: none; margin: 10px auto 0; max-width: 430px; padding: 12px 14px; border: 1px solid var(--line2); border-radius: 12px;
  background: rgba(10,18,32,.8); animation: soloIn .25s ease both; }
.solo-pick.on { display: block; }
@keyframes soloIn { from { opacity: 0; transform: translateY(-8px); } }
.solo-pick .sp-lbl { display: block; font-size: 13px; color: var(--mute); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.solo-pick .sp-btns { display: flex; gap: 8px; justify-content: center; }
.solo-pick .btn { flex: 1; }

#audio-ctl { position: fixed; left: 16px; bottom: 16px; display: flex; gap: 8px; z-index: 60; }
#audio-ctl .tool { width: 38px; height: 38px; font-size: 17px; }

/* =====================================================================
   COMPTES, PROFIL, MÉDAILLONS
   ===================================================================== */
#scr-auth, #scr-profile { display: none; }
#scr-auth.on, #scr-profile.on { display: block; }
.hidden { display: none !important; }

/* --- médaillon --- */
.medal { position: relative; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex: 0 0 auto;
  border: 2px solid var(--line2); background: radial-gradient(circle at 50% 30%, #1b2740, #0a1018);
  display: grid; place-items: center; font-size: 26px; box-shadow: inset 0 0 18px rgba(0,0,0,.6); }
.medal img { position: absolute; left: 50%; top: 50%; width: 100%; height: 100%; object-fit: cover; transform-origin: center;
  user-select: none; -webkit-user-drag: none; }
.medal.fallback img { display: none; }
.medal.fallback::after { content: attr(data-emoji); }
.medal.big { width: 132px; height: 132px; font-size: 62px; border-color: var(--gold); box-shadow: 0 0 26px rgba(217,174,82,.28), inset 0 0 22px rgba(0,0,0,.6); }
.medal.editable { cursor: grab; touch-action: none; margin: 4px auto 14px; }
.medal.editable:active { cursor: grabbing; }
.medal.bad { border-color: var(--red); }
.medal-lv { position: absolute; right: -2px; bottom: -2px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px;
  background: linear-gradient(180deg, #f0d089, #b98c2f); color: #1a1207; font: 700 12px/20px var(--display), sans-serif;
  text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.6); }
.medal.big .medal-lv { min-width: 30px; height: 30px; border-radius: 15px; font-size: 16px; line-height: 30px; }

/* --- jauge d'expérience --- */
.xpwrap { flex: 1; min-width: 180px; }
.xpbar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.xpbar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--cyan), var(--gold));
  box-shadow: 0 0 12px rgba(217,174,82,.5); transition: width .8s cubic-bezier(.3,1,.4,1); }
.xp-lbl { display: block; margin-top: 5px; font-size: 12px; color: var(--mute); }

/* --- barre de compte sur l'accueil --- */
.account-bar { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 0 auto 18px; max-width: 560px; }
.account-bar.on { padding: 10px 16px; border: 1px solid var(--line2); border-radius: 14px; background: rgba(10,18,32,.7); }
.ab-info { text-align: left; }
.ab-name { font-weight: 700; }
.ab-lv { font-size: 13px; color: var(--gold); }

/* --- écran connexion --- */
.auth-wrap { max-width: 460px; margin: 0 auto; padding-top: 140px; text-align: center; }
.auth-sub { color: var(--mute); margin: 0 0 24px; }
.fld { display: block; text-align: left; margin-bottom: 14px; }
.fld span { display: block; font-size: 13px; color: var(--mute); margin-bottom: 5px; letter-spacing: .06em; }
.fld input, .fld-in { width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line2);
  background: rgba(6,10,20,.9); color: var(--ink); font: inherit; }
.fld input:focus, .fld-in:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(98,226,255,.25); }
.auth-msg, .modal-msg { min-height: 20px; color: #ff9aa2; font-size: 14px; margin: 4px 0 14px; }

/* --- écran profil --- */
.prof-body { position: absolute; left: 0; right: 0; top: 96px; bottom: 0; overflow-y: auto; padding: 8px 40px 40px; }
.prof-loading { text-align: center; color: var(--mute); padding-top: 60px; }
.prof-head { display: flex; align-items: center; gap: 24px; max-width: 900px; margin: 0 auto 26px; }
.prof-id { flex: 1; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.prof-name { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: .06em; }
.prof-lv { color: var(--gold); font-size: 15px; }
.prof-cards { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; max-width: 900px; margin: 0 auto 30px; }
.pstat { min-width: 150px; padding: 14px 16px; border: 1px solid var(--line2); border-radius: 12px; background: rgba(10,18,32,.65); text-align: center; }
.ps-val { font-family: var(--display); font-size: 26px; font-weight: 700; }
.ps-lbl { font-size: 12px; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.ps-sub { font-size: 12px; color: var(--gold); margin-top: 4px; }
.prof-h3 { max-width: 900px; margin: 26px auto 12px; font-family: var(--display); font-size: 17px; letter-spacing: .1em; color: var(--mute); text-transform: uppercase; }
.prof-table { max-width: 900px; margin: 0 auto; width: 100%; border-collapse: collapse; }
.prof-table th, .prof-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: center; }
.prof-table th { color: var(--mute); font-weight: 500; font-size: 13px; }
.prof-table td:first-child, .prof-table th:first-child { text-align: left; }
.prof-table .w { color: #7ee3a6; font-weight: 700; }
.prof-table .l { color: #ff9aa2; }
.prof-collector { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; max-width: 900px; margin: 0 auto; }
.colc { width: 130px; text-align: center; }
.colc .card { width: 130px; }
.colc-lbl { margin-top: 8px; font-size: 13px; color: var(--gold); }
.colc.locked .colc-lbl { color: var(--mute); }
/* Carte encore verrouillée : plaque d'acier rivetée, la carte reste une surprise */
.colc.locked { position: relative; }
.colc.locked .card { visibility: hidden; }
.colc.locked::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: calc(100% - 26px); border-radius: 8px;
  background:
    repeating-linear-gradient(115deg, rgba(255,255,255,.045) 0 2px, transparent 2px 5px),
    linear-gradient(160deg, #8e97a4 0%, #5c6674 18%, #39424f 40%, #545d6b 62%, #2b3139 85%, #6b7481 100%);
  border: 2px solid #232a33;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.28), inset 0 -3px 8px rgba(0,0,0,.7), 0 8px 20px rgba(0,0,0,.6);
}
.colc.locked::after {
  content: '🔒'; position: absolute; left: 0; right: 0; top: 0; height: calc(100% - 26px);
  display: grid; place-items: center; font-size: 30px;
  text-shadow: 0 2px 6px rgba(0,0,0,.8);
  background-image:
    radial-gradient(circle at 12px 12px, #aab3c0 0 3px, #4b5461 3px 4.5px, transparent 5px),
    radial-gradient(circle at calc(100% - 12px) 12px, #aab3c0 0 3px, #4b5461 3px 4.5px, transparent 5px),
    radial-gradient(circle at 12px calc(100% - 12px), #aab3c0 0 3px, #4b5461 3px 4.5px, transparent 5px),
    radial-gradient(circle at calc(100% - 12px) calc(100% - 12px), #aab3c0 0 3px, #4b5461 3px 4.5px, transparent 5px);
}
.colc.locked:hover::before { filter: brightness(1.12); }

/* bouton de retour sur les écrans de partie */
.quit-btn { position: absolute; left: 24px; top: 22px; z-index: 5; }
.deck-quit { position: static; margin-right: 14px; }
.prof-lb { max-width: 620px; margin: 0 auto; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.lb-row.me { background: rgba(217,174,82,.1); border-radius: 8px; }
.lb-row .medal { width: 36px; height: 36px; font-size: 18px; }
.lb-rk { width: 34px; color: var(--mute); font-family: var(--display); }
.lb-nm { flex: 1; }
.lb-xp { color: var(--gold); font-size: 14px; }

/* --- fenêtre modale (éditeur d'avatar) --- */
.modal-back { position: absolute; inset: 0; background: rgba(4,6,13,.82); display: grid; place-items: center; z-index: 80; }
.modal { width: 420px; padding: 24px; border: 1px solid var(--line2); border-radius: 16px; background: linear-gradient(180deg, #0e1729, #080d18); text-align: center; }
.modal h3 { margin: 0 0 6px; font-family: var(--display); letter-spacing: .1em; }
.modal-sub { color: var(--mute); font-size: 13px; margin: 0 0 16px; }
.modal input[type=range] { width: 100%; margin: 14px 0 6px; accent-color: var(--gold); }
.zoom-row::before { content: 'Zoom'; display: block; font-size: 12px; color: var(--mute); text-align: left; margin-top: 12px; }

/* --- montée de niveau --- */
.levelup { position: absolute; inset: 0; display: none; place-items: center; pointer-events: none; z-index: 90; }
.levelup.on { display: grid; }
.levelup.on::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(70,48,4,.6), rgba(4,6,13,.9) 62%);
  backdrop-filter: blur(4px); animation: luBack 3.4s ease-in-out both;
}
@keyframes luBack { 0% { opacity: 0; } 10%, 80% { opacity: 1; } 100% { opacity: 0; } }
.lu-card { position: relative; z-index: 1; }
.lu-card { text-align: center; animation: luIn 3.4s cubic-bezier(.2,1.4,.3,1) both; }
@keyframes luIn {
  0% { opacity: 0; transform: scale(.5) translateY(30px); }
  12% { opacity: 1; transform: scale(1.06); }
  20% { transform: scale(1); }
  82% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.1) translateY(-20px); }
}
.lu-sub { font-size: 15px; letter-spacing: .3em; text-transform: uppercase; color: #f2dca6; }
.lu-lv { font-family: var(--display); font-weight: 900; font-size: 150px; line-height: 1;
  background: linear-gradient(180deg, #fff6d8, #f0cf86 40%, #b8861f 75%, #ffeec2);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(240,200,120,.6)); }
.lu-unlock { margin-top: 10px; color: var(--gold); font-size: 16px; }
.lu-spark { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 30%, #f3d089 60%, transparent 70%);
  animation: luSpark 1.8s ease-out forwards; }
@keyframes luSpark {
  0% { opacity: 0; transform: rotate(var(--a)) translateX(0) scale(.4); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) scale(1.1); }
}
.go-xp { margin: 16px auto 4px; max-width: 330px; color: var(--gold); font-size: 15px; }

/* --- titre de musique --- */
.music-toast { position: fixed; left: 16px; bottom: 66px; display: flex; align-items: center; gap: 9px;
  padding: 8px 14px 8px 11px; border: 1px solid var(--line2); border-radius: 22px; background: rgba(8,13,24,.86);
  color: var(--ink); font-size: 13px; opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .5s, transform .5s; z-index: 60; }
.music-toast.on { opacity: 1; transform: none; }
.music-toast i { color: var(--gold); font-style: normal; animation: notePulse 2s ease-in-out infinite; }
@keyframes notePulse { 50% { opacity: .45; } }

/* --- cartes collector : or et holographie --- */
.card.f-collector .c-bg { background-image: url(assets/card_blue.webp); filter: sepia(.35) saturate(1.3) hue-rotate(-8deg) brightness(1.02); }
.card.f-collector .c-frame { background-image: url(assets/frame_blue.webp); filter: sepia(.45) saturate(1.5) hue-rotate(-12deg) brightness(1.06); }
.card.gold .c-bg { filter: sepia(.85) saturate(2.1) hue-rotate(-14deg) brightness(1.12) contrast(1.05); }
.card.gold .c-frame { filter: sepia(1) saturate(2.6) hue-rotate(-12deg) brightness(1.2); }
.card.gold { box-shadow: 0 0 20px rgba(240,200,120,.4), 0 6px 18px rgba(0,0,0,.6); }
.card.gold .c-name, .card.gold .c-desc { filter: sepia(.35) brightness(1.04); }
.card.gold::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 34%, rgba(255,231,160,.55) 47%, rgba(255,255,255,.75) 51%, rgba(255,214,120,.5) 56%, transparent 68%);
  background-size: 280% 100%; mix-blend-mode: screen; animation: goldSweep 4.5s linear infinite;
}
.card.gold::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  background-image: radial-gradient(circle, rgba(255,245,205,.95) 0 1.2px, transparent 1.8px),
                    radial-gradient(circle, rgba(255,226,150,.8) 0 .9px, transparent 1.5px);
  background-size: 37px 29px, 23px 19px; mix-blend-mode: screen; animation: goldSparkle 3.2s steps(4) infinite;
}
@keyframes goldSweep { to { background-position: -280% 0; } }
@keyframes goldSparkle { 0% { opacity: .35; } 25% { opacity: .9; } 50% { opacity: .45; } 75% { opacity: 1; } 100% { opacity: .35; } }
.card.f-collector .c-fac { filter: hue-rotate(35deg) saturate(1.4); }

/* =====================================================================
   MENU SOLO, ADMINISTRATION, AJUSTEMENTS
   ===================================================================== */
.home-menu { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.home-menu.hidden { display: none; }

.solo-pick { position: relative; display: none; margin: 4px auto 0; max-width: 560px; padding: 22px 26px 24px;
  border: 1px solid var(--line2); border-radius: 16px; background: rgba(10,18,32,.86);
  box-shadow: 0 20px 50px rgba(0,0,0,.55); animation: soloIn .28s cubic-bezier(.2,1.3,.4,1) both; }
.solo-pick.on { display: block; }
.solo-close { position: absolute; right: 10px; top: 8px; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line2); background: rgba(255,255,255,.04); color: var(--mute); font-size: 15px; cursor: pointer;
  transition: transform .18s, color .18s, border-color .18s; }
.solo-close:hover { color: var(--ink); border-color: var(--red); transform: rotate(90deg); }
.solo-pick .sp-lbl { display: block; margin: 14px 0 9px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.solo-pick .sp-lbl:first-of-type { margin-top: 2px; }
.sp-btns { display: flex; gap: 10px; }
.btn.pick { flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 11px 8px; position: relative; overflow: hidden;
  transition: transform .18s cubic-bezier(.2,1.4,.4,1), border-color .18s, box-shadow .18s, background .18s; }
.btn.pick b { font-size: 15px; }
.btn.pick i { font-style: normal; font-size: 11px; color: var(--mute); letter-spacing: .04em; }
.btn.pick::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--cyan);
  transform: scaleX(0); transition: transform .25s cubic-bezier(.2,1.3,.4,1); }
.btn.pick:hover { transform: translateY(-2px); border-color: rgba(98,226,255,.5); }
.btn.pick:hover::after { transform: scaleX(.5); }
.btn.pick.sel { border-color: var(--cyan); background: linear-gradient(180deg, rgba(98,226,255,.16), rgba(98,226,255,.04));
  box-shadow: 0 0 0 1px rgba(98,226,255,.25), 0 6px 18px rgba(0,0,0,.4); }
.btn.pick.sel::after { transform: scaleX(1); }
.btn.pick.sel i { color: #bdf2ff; }
.btn.pick.fac-red.sel { border-color: var(--red); background: linear-gradient(180deg, rgba(227,32,43,.18), rgba(227,32,43,.04)); box-shadow: 0 0 0 1px rgba(227,32,43,.3), 0 6px 18px rgba(0,0,0,.4); }
.btn.pick.fac-red.sel::after, .btn.pick.fac-red:hover::after { background: var(--red); }
.btn.pick.fac-blue.sel { border-color: var(--violet); background: linear-gradient(180deg, rgba(125,89,242,.2), rgba(125,89,242,.04)); box-shadow: 0 0 0 1px rgba(125,89,242,.3), 0 6px 18px rgba(0,0,0,.4); }
.btn.pick.fac-blue.sel::after, .btn.pick.fac-blue:hover::after { background: var(--violet); }
.solo-go { width: 100%; margin-top: 22px; }

/* difficulté Légende : or et braise, grisée tant qu'elle est verrouillée */
.btn.pick.pick-legend { border-color: rgba(217,174,82,.55); background: linear-gradient(180deg, rgba(217,174,82,.14), rgba(255,90,40,.05)); }
.btn.pick.pick-legend b { color: #ffe4a3; letter-spacing: .04em; }
.btn.pick.pick-legend::after { background: linear-gradient(90deg, var(--gold), #ff7a3a); }
.btn.pick.pick-legend:hover { border-color: var(--gold); box-shadow: 0 0 16px rgba(217,174,82,.35); }
.btn.pick.pick-legend.sel { border-color: var(--gold); background: linear-gradient(180deg, rgba(217,174,82,.28), rgba(255,90,40,.08));
  box-shadow: 0 0 0 1px rgba(217,174,82,.4), 0 0 22px rgba(217,174,82,.35), 0 6px 18px rgba(0,0,0,.4); }
.btn.pick.pick-legend.sel i { color: #ffd9a0; }
.btn.pick.pick-legend.locked { filter: grayscale(.85) brightness(.7); cursor: not-allowed; }
.btn.pick.pick-legend.locked:hover { transform: none; box-shadow: none; border-color: rgba(217,174,82,.35); }
.btn.pick.pick-legend.locked::after { transform: scaleX(0); }

/* badge de niveau à l'extérieur du médaillon */
.medal-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.medal-wrap .medal-lv { position: absolute; right: -10px; bottom: -6px; }
.medal-wrap .medal { margin: 0; }

/* journal strictement réservé aux parties */
#log-panel.hidden, .tools.hidden { display: none !important; }

/* page d'administration */
#scr-admin { display: none; }
#scr-admin.on { display: block; }
.admin-search { max-width: 280px; margin-left: auto; }
.admin-body { position: absolute; left: 0; right: 0; top: 96px; bottom: 0; display: grid; grid-template-columns: 340px 1fr; gap: 24px; padding: 14px 30px 30px; }
.admin-list { overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: rgba(8,13,24,.6); padding: 8px; }
.adm-fac { margin: 12px 6px 6px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.adm-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; transition: background .15s; }
.adm-row:hover { background: rgba(255,255,255,.05); }
.adm-row.sel { background: rgba(98,226,255,.14); box-shadow: inset 0 0 0 1px rgba(98,226,255,.3); }
.adm-row.edited .adm-nm::after { content: ' ●'; color: var(--gold); font-size: 10px; vertical-align: middle; }
.adm-num { width: 34px; color: var(--mute); font-size: 12px; }
.adm-nm { flex: 1; font-size: 14px; }
.adm-ty { font-size: 11px; color: var(--mute); }
.admin-edit { display: grid; grid-template-columns: 260px 1fr; gap: 28px; overflow-y: auto; align-content: start; }
.adm-prev .card { width: 260px; }
.adm-form { max-width: 460px; }
.adm-form select.fld-in { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.adm-form input[type=file] { padding: 8px; }
.admin-link { margin: 26px auto 0; display: block; }
#solo-diff { flex-wrap: wrap; }
#solo-diff .btn.pick { min-width: 108px; }
