@font-face { font-family: "CinzelL"; src: url("fonts/cinzel.woff") format("woff"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "AlegreyaL"; src: url("fonts/alegreya-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "AlegreyaL"; src: url("fonts/alegreya-700.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "AlegreyaL"; src: url("fonts/alegreya-400i.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
:root {
  --navy: #6d1a2a; --navy2: #4a1420; --deep: #1d1d20; --sky: #f3e6d3; --white: #fdf9f3; --gold: #d4af37; --fire: #e8590c;
  --ok: #2f9e44; --bad: #c92a2a; --ink: #241a1c; --muted: #75666a;
  --serif: "CinzelL", "Cinzel", Georgia, serif; --sans: "AlegreyaL", "Alegreya Sans", system-ui, sans-serif;
  --meander: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='8' viewBox='0 0 16 8'><path d='M0 7.25H5.5V1.5H11V5H8V3.25' fill='none' stroke='white' stroke-width='1.3'/><path d='M5.5 7.25H16' fill='none' stroke='white' stroke-width='1.3'/></svg>");
  --safe-top: env(safe-area-inset-top, 0px); --safe-bot: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; }
body { font-family: var(--sans); color: var(--ink); background: var(--deep); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }
#app { position: relative; max-width: 520px; margin: 0 auto; min-height: 100dvh; height: 100dvh; overflow: hidden;
  background: radial-gradient(120% 60% at 50% 0%, #8e2236 0%, var(--navy) 40%, var(--navy2) 75%, var(--deep) 100%); }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; padding-top: var(--safe-top); padding-bottom: var(--safe-bot); }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.key { height: 10px; background: var(--navy2) var(--meander) repeat-x center / 20px 10px; opacity: .9; flex: none; }

/* ---------- Menu ---------- */
.menu { align-items: center; justify-content: flex-start; color: white; text-align: center; }
.hero { position: relative; width: 100%; height: 300px; flex: none; overflow: hidden; }
.hero .sky { position: absolute; inset: 0; background: linear-gradient(#b8566a, #f3e6d3 80%); }
.hero .sun { position: absolute; width: 90px; height: 90px; right: 50px; top: 46px; border-radius: 50%; background: radial-gradient(#fff6c8, #ffc94a); box-shadow: 0 0 60px #ffd36b; animation: sun 6s ease-in-out infinite alternate; }
@keyframes sun { to { transform: translateY(6px) scale(1.04); } }
.hero .sea { position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: repeating-linear-gradient(172deg, #6d1a2a 0 8px, #8e2236 8px 16px); animation: sea 8s linear infinite; background-size: 200% 100%; }
@keyframes sea { to { background-position: 200px 0; } }
.hero .house { position: absolute; left: 40px; bottom: 70px; width: 150px; height: 70px; background: white; border-radius: 3px; box-shadow: 0 4px 0 rgba(0,0,0,.08); }
.hero .house::before, .hero .house::after { content: ""; position: absolute; bottom: 12px; width: 22px; height: 34px; background: var(--navy); border-radius: 11px 11px 0 0; }
.hero .house::before { left: 30px; } .hero .house::after { right: 30px; }
.hero .dome { position: absolute; left: 70px; bottom: 140px; width: 90px; height: 46px; background: var(--navy); border-radius: 90px 90px 0 0; }
.hero .dome::after { content: ""; position: absolute; left: 50%; top: -24px; width: 4px; height: 24px; background: var(--navy); transform: translateX(-50%); }
.hero .dome::before { content: ""; position: absolute; left: 50%; top: -34px; width: 16px; height: 4px; background: var(--navy); transform: translateX(-50%); }
.title { font-family: var(--serif); font-weight: 900; font-size: 44px; letter-spacing: 2px; margin: 18px 0 0; line-height: 1; text-shadow: 0 3px 0 var(--navy2); }
.title .f { color: #ffb347; }
.subtitle { font-size: 16px; opacity: .9; margin: 6px 0 14px; font-style: italic; }
.rank { font-family: var(--sans); font-variant-numeric: lining-nums; display: inline-flex; gap: 10px; align-items: center; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: 30px; padding: 6px 14px; font-size: 15px; margin-bottom: 14px; }
.rank b { font-family: var(--serif); }
.num { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-variant-numeric: lining-nums tabular-nums; }
.btns { display: flex; flex-direction: column; gap: 12px; width: min(320px, 86%); margin-bottom: 18px; }
.bigbtn { border: 0; border-radius: 14px; padding: 15px 16px; font-family: var(--serif); font-weight: 800; font-size: 18px; letter-spacing: 1px; background: white; color: var(--navy); box-shadow: 0 4px 0 #c9b3a5; transition: transform .08s; }
.bigbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #c9b3a5; }
.bigbtn.primary { background: linear-gradient(#ff8a3c, #e8590c); color: white; box-shadow: 0 4px 0 #a33a05; }
.bigbtn.outline { background: transparent; color: white; border: 2px solid rgba(255,255,255,.5); box-shadow: none; }
.bigbtn:disabled { opacity: .45; }
.foot-note { font-size: 12px; opacity: .6; margin-top: auto; padding: 8px; }

/* ---------- Barres ---------- */
.topbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; color: white; flex: none; }
.topbar h2 { font-family: var(--serif); font-size: 19px; margin: 0; flex: 1; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: white; font-size: 19px; display: grid; place-items: center; }
.panel { background: var(--white); border-radius: 16px; margin: 10px; padding: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.panel h3 { font-family: var(--serif); color: var(--navy); margin: 0 0 8px; font-size: 17px; }
.panel p, .panel li { font-size: 15px; line-height: 1.35; }
.chip { display: inline-block; padding: 6px 11px; border-radius: 20px; background: rgba(255,255,255,.12); color: white; border: 1px solid rgba(255,255,255,.3); font-size: 14px; margin: 0 6px 6px 0; }
.chip.on { background: white; color: var(--navy); font-weight: 700; }
.chips { padding: 0 10px; white-space: nowrap; overflow-x: auto; flex: none; }

/* ---------- Cartes (main / collection) ---------- */
.hc { --c: #3a3a3f; --r: #9aa3ab; position: relative; width: 76px; height: 106px; border-radius: 9px; background: var(--navy); padding: 2px; flex: none; transition: transform .15s; touch-action: pan-x; }
.hc.leg { background: linear-gradient(135deg, #d4af37, #fff1b8 45%, #b8902a 60%, #f6e27a); }
.hc .in { width: 100%; height: 100%; border-radius: 7px; background: var(--white); overflow: hidden; display: flex; flex-direction: column; border: 2px solid var(--c); }
.hc .band { height: 15px; background: var(--c); color: white; font-family: var(--serif); font-size: 7px; letter-spacing: .5px; text-align: center; line-height: 15px; font-weight: 700; }
.hc .art { flex: 1; position: relative; background: linear-gradient(#f3e6d3, #fffaf2); overflow: hidden; }
.hc .art::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 9px; background: repeating-linear-gradient(170deg, #6d1a2a 0 3px, #8e2236 3px 6px); }
.hc .art .ini { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-weight: 900; font-size: 22px; color: white; -webkit-text-stroke: 1.2px var(--c); text-shadow: 0 2px 0 var(--c); padding-top: 4px; }
.hc .nm { font-family: var(--serif); font-weight: 700; font-size: 8.4px; text-align: center; color: #3a1018; line-height: 1.05; padding: 2px 2px 1px; height: 20px; display: grid; place-items: center; overflow: hidden; }
.hc .ty { font-size: 7.5px; text-align: center; color: var(--c); font-weight: 700; padding-bottom: 2px; text-transform: uppercase; letter-spacing: .2px; }
.cost, .pow { position: absolute; display: grid; place-items: center; font-family: var(--serif); font-weight: 900; color: white; z-index: 2; }
.cost { left: -5px; top: -5px; width: 25px; height: 25px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff9a3c, #d9480f 70%); border: 2px solid white; font-size: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.cost.down { background: radial-gradient(circle at 35% 30%, #69db7c, #2b8a3e 70%); }
.pow { right: -5px; top: -5px; width: 26px; height: 28px; background: radial-gradient(circle at 35% 30%, #c2334d, #6d1a2a 75%); clip-path: polygon(50% 0, 100% 22%, 100% 74%, 50% 100%, 0 74%, 0 22%); font-size: 14px; }
.pow::after { content: ""; position: absolute; inset: 0; }
.hc .gm { display: inline-block; width: 6px; height: 6px; background: var(--r); transform: rotate(45deg); border: 1px solid rgba(0,0,0,.25); margin-right: 3px; vertical-align: 0; }
.hc.sel { transform: translateY(-14px) scale(1.06); filter: drop-shadow(0 0 8px #ffd36b); }
.hc.dim { filter: grayscale(.6) brightness(.8); }
.hc.dim .cost { background: #777; }

/* ---------- Jeu ---------- */
.game { color: white; }
.ghead { display: flex; align-items: center; gap: 6px; padding: 6px 8px 2px; flex: none; }
.tipjar { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: 12px; padding: 4px 9px; font-weight: 700; font-size: 14px; }
.tipjar .x { font-family: var(--serif); font-size: 17px; color: #ffd36b; }
.tipjar .pend { font-size: 11px; color: #ffb347; }
.turnbox { flex: 1; text-align: center; font-family: var(--serif); font-weight: 800; font-size: 15px; }
.turnbox .dots { display: flex; gap: 4px; justify-content: center; margin-top: 2px; }
.turnbox .dots i { width: 14px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); }
.turnbox .dots i.on { background: #ffb347; }
.oppbar { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; padding: 0 10px 4px; opacity: .92; flex: none; gap: 6px; }
.oppbar .seen { background: rgba(255,211,107,.18); border: 1px solid #ffd36b; border-radius: 8px; padding: 1px 6px; }
.board { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 6px; min-height: 0; }
.col { display: flex; flex-direction: column; min-height: 0; }
.side { flex: 1; display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 84px; gap: 5px; padding: 4px; border-radius: 10px; align-content: start; min-height: 140px; transition: background .2s, box-shadow .2s; }
.side.opp { align-content: end; background: rgba(0,0,0,.12); }
.side.me { background: rgba(255,255,255,.07); }
.side.ok { background: rgba(255,211,107,.22); box-shadow: inset 0 0 0 2px #ffd36b; }
.side.hover { background: rgba(255,211,107,.42); }
.loc { position: relative; margin: 5px 0; border-radius: 12px; background: var(--white); color: var(--ink); padding: 5px 5px 4px; text-align: center; min-height: 92px; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 3px 0 rgba(0,0,0,.25); overflow: hidden; }
.loc::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--navy) var(--meander) repeat-x center / 12px 6px; }
.loc .ln { font-family: var(--serif); font-weight: 800; font-size: 11px; color: var(--navy); line-height: 1.05; margin-top: 4px; }
.loc .li { font-size: 18px; line-height: 1.1; }
.loc .le { font-size: 9.4px; line-height: 1.12; color: #4d3d40; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.loc.closed { background: repeating-linear-gradient(45deg, #e9e0d6 0 8px, #f3ede6 8px 16px); color: var(--muted); }
.loc.closed .ln { color: var(--muted); }
.loc .tot { position: absolute; left: 50%; transform: translateX(-50%); min-width: 30px; padding: 0 6px; height: 20px; border-radius: 10px; font-family: var(--serif); font-weight: 900; font-size: 13px; line-height: 20px; color: white; background: #77696c; }
.loc .tot.t { top: 7px; display: none; } .loc .tot.b { bottom: 3px; display: none; }
.loc.open .tot { display: block; }
.loc.open { padding-top: 26px; padding-bottom: 24px; }
.loc .tot.lead { background: var(--ok); box-shadow: 0 0 0 2px #b2f2bb; }
.loc .tot.trail { background: #8f8486; }
.loc.flipin { animation: flipin .6s ease; }
@keyframes flipin { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }
.mc { --c: #3a3a3f; position: relative; border-radius: 8px; background: var(--white); border: 2px solid var(--c); overflow: visible; color: var(--ink); }
.mc .ini { position: absolute; inset: 14px 0 14px; display: grid; place-items: center; font-family: var(--serif); font-weight: 900; font-size: 21px; color: white; -webkit-text-stroke: 1px var(--c); text-shadow: 0 1px 0 var(--c); background: linear-gradient(#f3e6d3, #fffaf2); }
.mc .bar { position: absolute; left: 0; right: 0; top: 0; height: 14px; background: var(--c); font-size: 10px; text-align: left; padding-left: 3px; line-height: 14px; border-radius: 5px 5px 0 0; }
.mc .n { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; font-size: 9.5px; text-align: center; font-weight: 700; color: #3a1018; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; line-height: 14px; }
.mc .p { position: absolute; right: -6px; top: -6px; width: 24px; height: 26px; display: grid; place-items: center; font-family: var(--serif); font-weight: 900; font-size: 13px; color: white;
  background: radial-gradient(circle at 35% 30%, #c2334d, #6d1a2a 75%); clip-path: polygon(50% 0, 100% 22%, 100% 74%, 50% 100%, 0 74%, 0 22%); z-index: 3; }
.mc .p.up { background: radial-gradient(circle at 35% 30%, #69db7c, #2b8a3e 75%); }
.mc .p.dn { background: radial-gradient(circle at 35% 30%, #ff8787, #c92a2a 75%); }
.mc.leg { border-color: var(--gold); box-shadow: 0 0 0 1px #fff1b8, 0 0 8px rgba(212,175,55,.8); }
.mc.back { background: var(--navy) var(--meander) repeat center / 14px 7px; border-color: white; }
.mc.back::after { content: "TG"; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-weight: 900; color: white; font-size: 15px; text-shadow: 0 0 6px var(--navy); }
.mc.back.mine { outline: 2px dashed #ffd36b; outline-offset: 1px; }
.mc.frozen::before { content: "❄️"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 22px; z-index: 2; }
.mc.frozen { background: linear-gradient(135deg, #e3f4ff, #e6d3bd); border-color: #74c0fc; }
.mc.frozen::after { content: ""; }
.mc.tok { --c: #8f8486; }
.mc.tok .ini { font-size: 22px; -webkit-text-stroke: 0; text-shadow: none; }
.mc .ord { position: absolute; left: -5px; bottom: -6px; background: #ffd36b; color: var(--navy); border-radius: 8px; font-size: 10px; font-weight: 800; padding: 0 4px; z-index: 3; }
.mc .can { position: absolute; left: -5px; bottom: -6px; background: white; color: var(--navy); border-radius: 8px; font-size: 10px; padding: 0 4px; z-index: 3; border: 1px solid var(--navy); }
.mc.flip { animation: flip .5s ease; }
@keyframes flip { 0% { transform: rotateY(90deg) scale(1.15); } 60% { transform: rotateY(0) scale(1.12); } 100% { transform: scale(1); } }
.mc.pulse { animation: pulse .45s ease; }
@keyframes pulse { 50% { transform: scale(1.18); } }
.mc.slide { animation: slide .45s ease; }
@keyframes slide { from { transform: translateY(-14px) scale(.8); opacity: .3; } }
.mc.pop { animation: pop .35s ease; }
@keyframes pop { from { transform: scale(0); } }
.float { position: absolute; z-index: 50; font-family: var(--serif); font-weight: 900; font-size: 20px; pointer-events: none; animation: float 1s ease-out forwards; text-shadow: 0 2px 0 rgba(0,0,0,.5); }
.float.up { color: #8ce99a; } .float.dn { color: #ff8787; } .float.blk { color: #e6d3bd; font-size: 14px; }
@keyframes float { from { transform: translate(-50%, 0) scale(.8); opacity: 1; } to { transform: translate(-50%, -38px) scale(1.15); opacity: 0; } }
.tot.bump { animation: pulse .4s ease; }
.handbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px 2px; flex: none; }
.energy { display: flex; align-items: center; gap: 6px; font-family: var(--serif); font-weight: 900; }
.energy .flame { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; color: white; background: radial-gradient(circle at 40% 35%, #ffb347, #e8590c 65%, #a33a05); border: 3px solid white; box-shadow: 0 0 14px rgba(255,138,60,.6); position: relative; }
.energy .flame small { position: absolute; bottom: -9px; font-size: 9px; background: var(--navy); border-radius: 6px; padding: 0 4px; }
.energy .lbl { font-family: var(--sans); font-size: 11px; line-height: 1.1; opacity: .85; font-weight: 400; }
.actbtn { border: 0; border-radius: 12px; padding: 10px 12px; font-family: var(--serif); font-weight: 900; font-size: 14px; color: white; }
.actbtn.go { margin-left: auto; background: linear-gradient(#ff8a3c, #e8590c); box-shadow: 0 3px 0 #a33a05; padding: 11px 18px; font-size: 16px; }
.actbtn.tip { background: linear-gradient(#ffd36b, #d4a017); color: #3d2a00; box-shadow: 0 3px 0 #8a6d12; font-size: 12.5px; }
.actbtn:disabled { opacity: .45; }
.actbtn:active { transform: translateY(2px); }
.hand { display: flex; gap: 6px; padding: 18px 10px 10px; overflow-x: auto; flex: none; min-height: 132px; align-items: flex-end; }
.hand:empty::after { content: "Main vide"; opacity: .6; font-style: italic; margin: auto; }
.status { text-align: center; font-size: 13px; min-height: 18px; color: #ffe8a3; flex: none; padding: 0 8px; }
.tapfast { position: absolute; inset: 0; z-index: 40; }
.ghost { position: fixed; z-index: 100; pointer-events: none; transform: translate(-50%, -60%) scale(1.08); opacity: .92; filter: drop-shadow(0 8px 12px rgba(0,0,0,.5)); }

/* ---------- Toasts / modales ---------- */
#toasts { position: fixed; left: 50%; top: calc(64px + var(--safe-top)); transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(92vw, 460px); }
.toast { background: rgba(74,20,32,.95); color: white; border: 1px solid #ffd36b; border-radius: 12px; padding: 8px 14px; font-size: 14.5px; box-shadow: 0 4px 14px rgba(0,0,0,.4); animation: tin .25s ease; text-align: center; }
.toast.loud { font-family: var(--serif); font-weight: 900; font-size: 20px; background: linear-gradient(#ffd36b, #d4a017); color: #3d2a00; border-color: white; }
@keyframes tin { from { transform: translateY(-10px); opacity: 0; } }
#modal { position: fixed; inset: 0; z-index: 150; background: rgba(22,14,16,.72); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--white); width: min(520px, 100%); max-height: 88dvh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 16px 16px calc(16px + var(--safe-bot)); animation: sheet .25s ease; }
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
.sheet h3 { font-family: var(--serif); color: var(--navy); margin: 4px 0 10px; }
.sheet .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.sheet .row button { flex: 1; min-width: 120px; }
.sbtn { border: 0; border-radius: 12px; padding: 12px; font-weight: 700; font-size: 15px; background: #efe7de; color: var(--navy); }
.sbtn.pri { background: var(--navy); color: white; } .sbtn.warn { background: #ffe3e3; color: var(--bad); }
/* grande carte (fiche) */
.big { --c: #3a3a3f; --r: #9aa3ab; width: 250px; height: 350px; margin: 4px auto 8px; border-radius: 14px; background: var(--navy); padding: 6px; position: relative; }
.big.leg { background: linear-gradient(135deg, #d4af37, #fff1b8 40%, #b8902a 60%, #f6e27a); }
.big .fr { height: 100%; border-radius: 10px; background: var(--white); border: 2px solid var(--c); overflow: hidden; display: flex; flex-direction: column; }
.big .tp { height: 36px; background: var(--c); color: white; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 700; letter-spacing: 1px; font-size: 12px; border-bottom: 3px solid rgba(255,255,255,.5); }
.big .cost { width: 42px; height: 42px; font-size: 22px; left: -2px; top: -2px; border-width: 3px; }
.big .pow { width: 42px; height: 46px; font-size: 22px; right: -2px; top: -2px; }
.big .ar { height: 96px; position: relative; background: linear-gradient(#f3e6d3, #fffaf2); overflow: hidden; }
.big .ar::before { content: ""; position: absolute; left: 0; right: 0; bottom: 10px; height: 26px; background: repeating-linear-gradient(170deg, #6d1a2a 0 5px, #8e2236 5px 10px); }
.big .ar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: var(--navy) var(--meander) repeat-x center / 20px 10px; }
.big .sun { position: absolute; right: 26px; top: 10px; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(#fff6c8, #ffd36b); }
.big .hs { position: absolute; left: 18px; bottom: 26px; width: 66px; height: 30px; background: white; border: 1px solid #e0d6cb; }
.big .dm { position: absolute; left: 30px; bottom: 56px; width: 42px; height: 22px; border-radius: 42px 42px 0 0; background: var(--c); }
.big .ii { position: absolute; right: 20px; bottom: 30px; font-family: var(--serif); font-weight: 900; font-size: 44px; color: white; -webkit-text-stroke: 2px var(--c); text-shadow: 0 2px 0 var(--c); }
.big .nm2 { font-family: var(--serif); font-weight: 800; color: #3a1018; text-align: center; font-size: 16px; padding: 6px 6px 0; line-height: 1.1; }
.big .sb { text-align: center; font-size: 11.5px; color: #5c4b4e; padding: 1px 6px 5px; }
.big .sb i { display: inline-block; width: 8px; height: 8px; background: var(--r); transform: rotate(45deg); margin-right: 5px; }
.big .ab { flex: 1; margin: 0 8px; border-radius: 8px; background: #f7f2ec; border: 1px solid #dccfc2; border-left: 5px solid var(--c); padding: 6px 8px; }
.big .ab .k { font-family: var(--serif); font-weight: 800; font-size: 11px; color: var(--c); text-transform: uppercase; }
.big .ab .tx { font-size: 14.5px; line-height: 1.22; margin-top: 2px; }
.big .ab .tg { display: inline-block; margin-top: 5px; font-size: 10.5px; color: white; background: var(--c); border-radius: 5px; padding: 1px 6px; margin-right: 4px; }
.big .fl { font-style: italic; font-size: 12px; text-align: center; color: #5a4548; padding: 5px 10px 7px; }
.modlist { font-size: 13px; color: var(--muted); margin: 0 0 6px; text-align: center; }

/* ---------- Brigades ---------- */
.deckitem { display: flex; gap: 10px; align-items: center; background: var(--white); border-radius: 14px; margin: 8px 10px; padding: 10px 12px; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.deckitem .dn { font-family: var(--serif); font-weight: 800; color: var(--navy); font-size: 15px; }
.deckitem .dd { font-size: 12.5px; color: var(--muted); }
.deckitem .meta { flex: 1; min-width: 0; }
.badge { display: inline-block; font-size: 10.5px; border-radius: 6px; padding: 1px 6px; color: white; margin-right: 4px; vertical-align: 1px; }
.curve { display: flex; gap: 2px; align-items: flex-end; height: 26px; }
.curve i { width: 7px; background: var(--navy); border-radius: 2px 2px 0 0; display: block; }
.deckitem.sel { box-shadow: 0 0 0 3px #ffd36b, 0 3px 0 rgba(0,0,0,.2); }
.smallbtn { border: 0; border-radius: 10px; padding: 8px 10px; background: #efe7de; color: var(--navy); font-weight: 700; font-size: 13px; }
.smallbtn.pri { background: var(--navy); color: white; }
.builderhead { background: var(--white); margin: 0 10px 8px; border-radius: 14px; padding: 8px 10px; flex: none; }
.builderhead input { width: 100%; border: 1px solid #dccfc2; border-radius: 10px; padding: 8px 10px; font-family: var(--serif); font-weight: 700; font-size: 15px; color: var(--navy); }
.counts { display: flex; gap: 10px; align-items: center; margin-top: 6px; font-size: 13px; color: var(--muted); }
.counts b { color: var(--ink); } .counts .bad { color: var(--bad); }
.decksel { display: flex; gap: 4px; overflow-x: auto; margin-top: 6px; min-height: 34px; padding-bottom: 2px; }
.decksel .mini { flex: none; width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; color: white; font-family: var(--serif); font-weight: 900; font-size: 11px; position: relative; }
.decksel .mini b { position: absolute; top: -4px; left: -3px; background: var(--fire); border-radius: 50%; width: 14px; height: 14px; font-size: 9px; display: grid; place-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 14px 8px; padding: 12px 12px 90px; justify-items: center; }
.grid .wrap { position: relative; }
.grid .wrap.in .hc { box-shadow: 0 0 0 3px #ffd36b; border-radius: 9px; }
.grid .wrap.in::after { content: "✓"; position: absolute; bottom: -6px; right: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--ok); color: white; display: grid; place-items: center; font-weight: 900; font-size: 13px; z-index: 4; }
.grid .info { position: absolute; left: -4px; bottom: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: white; color: var(--navy); font-weight: 900; font-size: 12px; z-index: 4; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.savebar { z-index: 10; position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(10px + var(--safe-bot)); background: linear-gradient(transparent, rgba(29,29,32,.95) 30%); display: flex; gap: 8px; }
.savebar button { flex: 1; }
.help h4 { font-family: var(--serif); color: var(--navy); margin: 12px 0 4px; font-size: 15px; }
.help .lc { border-left: 4px solid var(--navy); padding: 4px 8px; margin: 6px 0; background: #f7f2ec; border-radius: 6px; font-size: 14px; }
.help .kw b { color: var(--navy); }
/* fin */
.endov { position: absolute; inset: 0; z-index: 120; background: rgba(22,14,16,.8); display: flex; align-items: center; justify-content: center; padding: 16px; }
.endcard { background: var(--white); width: 100%; border-radius: 20px; padding: 18px 16px; text-align: center; animation: sheet .35s ease; }
.endcard h2 { font-family: var(--serif); font-weight: 900; font-size: 28px; margin: 0; color: var(--navy); }
.endcard h2.win { color: #2b8a3e; } .endcard h2.lose { color: var(--bad); }
.endcard .zs { display: flex; gap: 6px; margin: 12px 0; }
.endcard .zs div { flex: 1; background: #f7f2ec; border-radius: 10px; padding: 6px 4px; font-size: 12px; }
.endcard .zs b { font-family: var(--serif); font-size: 16px; display: block; }
.endcard .gain { font-family: var(--serif); font-weight: 900; font-size: 26px; margin: 8px 0; }
.prog { height: 10px; background: #efe7de; border-radius: 5px; overflow: hidden; margin: 6px 0 2px; }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, #ffd36b, #e8590c); }
.coach { position: absolute; inset: 0; z-index: 130; background: rgba(22,14,16,.75); display: flex; align-items: center; justify-content: center; padding: 18px; }
.coach .panel { margin: 0; }
@media (max-height: 700px) { .side { grid-auto-rows: 64px; min-height: 120px; } .loc { min-height: 80px; } .hand { min-height: 120px; padding-top: 14px; } .hc { width: 70px; height: 98px; } }
@media (min-width: 440px) and (min-height: 701px) { .side { grid-auto-rows: 92px; } }
