/* Warband. A heraldic war camp over CraftPix's flat-colour pixel art: woad-blue cloth panels with brass trim and a
   stitched inner seam, parchment text. Azure is you, crimson is the enemy, brass is gold and rewards.
   Cinzel for carved titles, Pixelify Sans for numbers and buttons, Alegreya Sans for reading. */
:root {
  --ink: #12100c;          /* outlines, umber night */
  --card: #1c2436;         /* woad cloth */
  --card2: #243049;
  --card3: #2f3e5c;
  --card4: #3a4b6e;
  --weave: rgba(255, 255, 255, .025);
  --text: #f3ead6;         /* parchment */
  --mute: #aab3c6;
  --brass: #c9a24a;
  --brass-hi: #e9c66c;
  --brass2: #7c6127;
  --you: #5aa9e6;          /* azure: your side */
  --you2: #24527e;
  --foe: #d24a3a;          /* crimson: the enemy, lost health */
  --foe2: #7a2219;
  --well: #121826;         /* inset wells */
  --c1: #8d9099; --c2: #5fa35a; --c3: #3f86d0; --c4: #9a5fd0; --c5: #e0a83a;
  --lift: 0 3px 0 var(--ink), 0 6px 12px rgba(0, 0, 0, .28);
  --r: 10px;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --num: "Rubik", "Alegreya Sans", system-ui, sans-serif;
  --pixel: "Pixelify Sans", "Alegreya Sans", system-ui, sans-serif;
  --body: "Alegreya Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--text); font-family: var(--body); font-weight: 700; font-size: 16px; }
body { overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--brass-hi); text-underline-offset: 3px; }
[hidden] { display: none !important; }
::selection { background: var(--brass); color: var(--ink); }
.icon, .ti, .tic, .port, .pp { image-rendering: pixelated; }
* { scrollbar-color: var(--brass2) var(--card); scrollbar-width: thin; }
.cloth { background-color: var(--card); background-image: repeating-linear-gradient(45deg, var(--weave) 0 2px, transparent 2px 5px), repeating-linear-gradient(-45deg, var(--weave) 0 2px, transparent 2px 5px); }

/* ---------- layout */
.app { position: fixed; inset: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr) 216px; grid-template-rows: auto minmax(0, 1fr) auto; user-select: none; -webkit-user-select: none; }
.arena { grid-area: 1 / 1 / -1 / -1; position: relative; min-height: 0; touch-action: none; }
body.ingame .arena { grid-area: 2 / 1 / 3 / -1; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.top, .shopbar, .card, .info, .tip, .banner {
  background-color: var(--card);
  background-image: repeating-linear-gradient(45deg, var(--weave) 0 2px, transparent 2px 5px), repeating-linear-gradient(-45deg, var(--weave) 0 2px, transparent 2px 5px);
}
.top { grid-area: 1 / 1 / 2 / -1; display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 2px solid var(--brass2); box-shadow: 0 2px 0 var(--ink), 0 6px 14px rgba(0, 0, 0, .3); z-index: 4; position: relative; }
.top::after, .shopbar::before { content: ""; position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed rgba(233, 198, 108, .35); pointer-events: none; }
.top::after { bottom: 4px; }
.shopbar::before { top: 4px; }
.traits { grid-area: 2 / 1 / 3 / 2; padding: 10px 8px 10px 12px; overflow: auto; z-index: 3; background: linear-gradient(90deg, rgba(18, 16, 12, .74), rgba(18, 16, 12, 0)); }
.players { grid-area: 2 / 3 / 3 / 4; padding: 10px 12px 10px 8px; overflow: auto; z-index: 3; background: linear-gradient(270deg, rgba(18, 16, 12, .74), rgba(18, 16, 12, 0)); }
.shopbar { grid-area: 3 / 1 / 4 / -1; display: flex; align-items: stretch; gap: 10px; padding: 12px 12px 18px; border-top: 2px solid var(--brass2); position: relative; z-index: 4; box-shadow: 0 -2px 0 var(--ink); }

/* ---------- shared pieces */
.card {
  color: var(--text); border: 2px solid var(--brass2); border-radius: var(--r);
  box-shadow: 0 0 0 2px var(--ink), 0 6px 0 2px var(--ink), 0 16px 40px rgba(0, 0, 0, .55);
  outline: 1px dashed rgba(233, 198, 108, .32); outline-offset: -8px;
  padding: 24px 28px; max-width: min(560px, 94vw); max-height: 92vh; overflow: auto; position: relative; user-select: text;
}
.card.wide { max-width: min(860px, 96vw); width: 100%; }
.card h1, .card h2, .card h3 { font-family: var(--display); font-weight: 900; margin: 0 0 10px; letter-spacing: .02em; color: var(--brass-hi); text-wrap: balance; }
.card h2 { font-size: 32px; line-height: 1.1; }
.sub { margin: 0 0 12px; color: var(--mute); font-weight: 500; font-size: 17px; line-height: 1.45; }
.small { font-size: 15px; margin: 14px 0 0; text-align: center; font-weight: 500; }
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; z-index: 20; }
.screen.dim { background: rgba(10, 12, 20, .72); }
.btns { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.btns.col { flex-direction: column; align-items: stretch; }
.btn {
  font-family: var(--pixel); font-weight: 500; font-size: 21px; line-height: 1; letter-spacing: .02em; padding: 10px 20px 9px; border: 2px solid var(--ink); color: var(--text);
  border-radius: 8px; background: var(--card3); box-shadow: inset 0 0 0 1px rgba(233, 198, 108, .35), var(--lift); transition: transform .06s, box-shadow .06s, background .12s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { background: var(--card4); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 0 0 1px rgba(233, 198, 108, .35), 0 1px 0 var(--ink); }
.btn.gold { background: var(--brass); color: var(--ink); box-shadow: inset 0 -3px 0 var(--brass2), inset 0 1px 0 rgba(255, 245, 210, .5), var(--lift); }
.btn.gold:hover { background: var(--brass-hi); }
.btn.small { font-size: 17px; padding: 7px 12px 6px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn:focus-visible, .sq:focus-visible, .ucard:focus-visible, .trait:focus-visible, .setrow button:focus-visible, .chartbtn:focus-visible { outline: 2px solid var(--you); outline-offset: 2px; }
.coin {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--brass-hi); flex: none;
  border: 2px solid var(--ink); vertical-align: -2px; box-shadow: inset -2px -2px 0 var(--brass2);
}
.coin.sm { width: 11px; height: 11px; border-width: 1.5px; margin-right: 3px; }
.heart { width: 18px; height: 16px; flex: none; background: #ff7a6a; clip-path: path("M9 16 L1.6 8.4 A4.4 4.4 0 0 1 9 2.6 A4.4 4.4 0 0 1 16.4 8.4 Z"); filter: drop-shadow(0 1px 0 var(--ink)); }
.icon, .ti, .tic { display: inline-block; flex: none; background-repeat: no-repeat; }

/* ---------- top bar */
.roundbox { font-family: var(--num); font-weight: 700; font-size: 26px; line-height: 1; display: flex; align-items: baseline; gap: 6px; color: var(--brass-hi); }
.roundbox .lbl { font-family: var(--display); font-size: 15px; color: var(--mute); letter-spacing: .06em; }
.phase { font-family: var(--body); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--ink); background: var(--you); border-radius: 4px; padding: 3px 8px; margin-left: 4px; align-self: center; }
.phase:empty { display: none; }
.groundchip { display: flex; flex-direction: column; padding: 3px 12px 4px; border: 2px solid var(--ink); border-radius: 8px; background: var(--well); box-shadow: inset 0 0 0 1px rgba(233, 198, 108, .2); }
.groundchip .gl { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--mute); font-weight: 800; }
.groundchip b { font-family: var(--display); font-weight: 900; font-size: 17px; line-height: 1.05; color: var(--text); }
.spacer { flex: 1; }
.stat { display: flex; align-items: center; gap: 7px; font-family: var(--num); font-weight: 700; font-size: 24px; line-height: 1; padding: 5px 12px 4px; border: 2px solid var(--ink); border-radius: 8px; background: var(--well); font-variant-numeric: tabular-nums; }
.stat.hp b { color: #ff9a8a; }
.stat.gold b { color: var(--brass-hi); }
.stat .coin { width: 17px; height: 17px; }
.stat.lvl .lbl { font-size: 17px; color: var(--mute); }
.xpbar { width: 64px; height: 8px; border: 1px solid var(--ink); border-radius: 2px; background: #10141f; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: var(--you); width: 100%; transform: scaleX(0); transform-origin: left; transition: transform .3s cubic-bezier(.16, 1, .3, 1); }
.stat small { font-family: var(--body); font-size: 13px; color: var(--mute); }
.sq { width: 40px; height: 40px; border: 2px solid var(--ink); border-radius: 8px; background: var(--card3); color: var(--text); box-shadow: inset 0 0 0 1px rgba(233, 198, 108, .35), var(--lift); font-family: var(--pixel); font-size: 20px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.sq:hover { background: var(--card4); }
.sq:active { transform: translateY(2px); }
.pausebars { display: inline-flex; gap: 4px; }
.pausebars i { width: 5px; height: 15px; background: var(--text); border-radius: 1px; }
.gridico { width: 20px; height: 20px; fill: none; stroke: var(--brass-hi); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

/* ---------- side panels */
.trhead { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.chartbtn { border: 1px solid var(--brass2); background: var(--card2); color: var(--brass-hi); border-radius: 6px; font-family: var(--pixel); font-size: 15px; line-height: 1; padding: 4px 8px 3px; box-shadow: var(--lift); }
.chartbtn:hover { background: var(--card3); }
.traits h3, .players h3 { font-family: var(--display); font-weight: 900; font-size: 18px; letter-spacing: .03em; color: var(--brass-hi); margin: 0 0 8px; text-shadow: 0 2px 0 var(--ink); }
.traits .empty { color: var(--text); font-size: 15px; margin: 0; line-height: 1.4; font-weight: 500; text-shadow: 0 1px 0 var(--ink); }
.trait { display: grid; grid-template-columns: 34px 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 6px 8px; margin-bottom: 6px; background: rgba(28, 36, 54, .78); border: 1px solid #34425f; border-radius: 8px; cursor: pointer; }
.trait .tic { width: 34px; height: 34px; grid-row: 1 / 3; filter: grayscale(1) brightness(.7); border: 1px solid var(--ink); border-radius: 6px; }
.trait .tn { font-size: 15px; font-weight: 800; }
.trait .tc { font-family: var(--num); font-weight: 700; font-size: 17px; color: var(--mute); }
.trait .tsteps { grid-column: 2 / 4; display: flex; gap: 4px; }
.trait .tsteps i { font-style: normal; font-size: 12px; font-weight: 800; padding: 0 5px; border-radius: 4px; background: rgba(255, 255, 255, .07); color: var(--mute); }
.trait .tsteps i.on { background: var(--you); color: var(--ink); }
.trait.on { background: var(--card2); border-color: var(--you2); box-shadow: var(--lift); }
.trait.on .tic { filter: none; }
.trait.on .tc { color: var(--text); }
.trait.on.lv2, .trait.on.lv3 { border-color: var(--brass); }
.trait.on.lv2 .tsteps i.on, .trait.on.lv3 .tsteps i.on { background: var(--brass-hi); }

.pl { display: grid; grid-template-columns: 34px 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 5px 7px; margin-bottom: 5px; background: rgba(28, 36, 54, .85); border: 1px solid #34425f; border-radius: 8px; }
.pl .pp { grid-row: 1 / 3; width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--ink); background: var(--well) center / cover no-repeat; }
.pl .pn { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl .pn em { font-style: normal; color: #ff9a8a; }
.pl .plv { font-size: 12px; color: var(--mute); text-align: right; display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.streak { font-family: var(--num); font-weight: 700; font-size: 11px; line-height: 1; padding: 2px 4px 1px; border-radius: 3px; color: var(--ink); }
.streak.win { background: var(--brass-hi); }
.streak.loss { background: #9aa6bd; }
.pl .ph { grid-column: 2 / 4; display: flex; gap: 6px; align-items: center; font-family: var(--num); font-weight: 700; font-size: 16px; line-height: 1; font-variant-numeric: tabular-nums; }
.pl .hb { flex: 1; height: 7px; border: 1px solid var(--ink); border-radius: 2px; background: #3a1f1c; overflow: hidden; }
.pl .hb i { display: block; height: 100%; width: 100%; background: #c9b896; transform-origin: left; transition: transform .5s cubic-bezier(.16, 1, .3, 1); }
.pl.me { background: var(--card2); border-color: var(--you); }
.pl.me .hb i { background: var(--you); }
.pl.vs { border-color: var(--foe); background: #2c1c22; }
.pl.hit .hb i { background: var(--foe); }
.pl.out { opacity: .45; filter: grayscale(1); }
.pl .pplace { color: var(--mute); }

/* ---------- shop */
.shopleft, .shopright { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.btn.buy { flex-direction: column; gap: 2px; padding: 7px 12px 6px; min-width: 104px; font-size: 19px; }
.btn.buy .price { display: inline-flex; align-items: center; font-family: var(--body); font-size: 14px; font-weight: 800; color: var(--brass-hi); }
.btn.lock { font-size: 18px; padding: 6px 12px 5px; }
.btn.lock.on { background: var(--brass); color: var(--ink); }
.padlock { width: 13px; height: 11px; border: 2.5px solid currentColor; border-radius: 2px; position: relative; margin-top: 5px; }
.padlock::before { content: ""; position: absolute; left: 1px; top: -9px; width: 6px; height: 8px; border: 2.5px solid currentColor; border-bottom: 0; border-radius: 6px 6px 0 0; }
.btn.lock.on .padlock { background: currentColor; }
.btn.fight { font-size: 28px; font-weight: 700; padding: 12px 22px 10px; min-width: 132px; }
.cards { flex: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; min-width: 0; }
.ucard { position: relative; display: grid; grid-template-columns: 54px 1fr; grid-template-rows: auto auto auto auto; align-content: start; column-gap: 9px; align-items: center; text-align: left; padding: 9px 9px 8px; border: 2px solid var(--ink); border-radius: 8px; background: var(--card2); color: var(--text); box-shadow: inset 0 0 0 1px var(--cc, var(--c1)), var(--lift); min-width: 0; overflow: hidden; }
.ucard::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--cc, var(--c1)); }
.ucard.c1 { --cc: var(--c1); } .ucard.c2 { --cc: var(--c2); } .ucard.c3 { --cc: var(--c3); } .ucard.c4 { --cc: var(--c4); } .ucard.c5 { --cc: var(--c5); }

/* rarity tag in the card's top left corner (Common, Uncommon, Rare, Epic, Legendary) */
.ucard .utop { position: absolute; left: 0; top: 0; right: 40px; z-index: 1; display: flex; align-items: center; gap: 6px; pointer-events: none; overflow: hidden; }
.ucard .ujob { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.ucard .urar { flex: none; padding: 1px 7px 2px 6px; border-bottom-right-radius: 6px; background: var(--cc, var(--c1)); color: #12100c; font-family: var(--body); font-weight: 800; font-size: 10.5px; line-height: 1.2; text-transform: uppercase; letter-spacing: .08em; pointer-events: none; }
.ucard:not(.empty) { padding-top: 17px; }
.info .icost { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; }
.info .irar { flex-basis: 100%; text-align: right; margin-top: 4px; font-style: normal; font-family: var(--body); font-weight: 800; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--cc, var(--c1)); filter: brightness(1.35); }
.info .irar.c1 { --cc: var(--c1); } .info .irar.c2 { --cc: var(--c2); } .info .irar.c3 { --cc: var(--c3); } .info .irar.c4 { --cc: var(--c4); } .info .irar.c5 { --cc: var(--c5); }
.ucard .port { grid-row: 1 / 4; width: 54px; height: 54px; border-radius: 6px; border: 1px solid var(--ink); background: var(--well) center / cover no-repeat; }
.ucard .un { font-family: var(--display); font-weight: 900; font-size: 14px; line-height: 1.05; padding: 4px 34px 2px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ucard .ut { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--mute); white-space: nowrap; overflow: hidden; }
.ucard .ti { width: 15px; height: 15px; border-radius: 3px; }
.ucard .uab { grid-column: 1 / 3; margin-top: 7px; padding: 3px 8px; border-radius: 4px; background: var(--well); color: var(--brass-hi); font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ucard .uc { position: absolute; right: 8px; top: 9px; display: inline-flex; align-items: center; font-family: var(--num); font-weight: 700; font-size: 20px; line-height: 1; color: var(--brass-hi); }
.ucard .own { position: absolute; right: 8px; top: 32px; display: flex; gap: 2px; }
.ucard .own i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .1); border: 1px solid var(--ink); }
.ucard .own i.on { background: var(--you); }
.ucard .own i.new { background: transparent; border: 1px dashed var(--brass-hi); }
.ucard.merge { box-shadow: inset 0 0 0 2px var(--brass-hi), 0 0 14px rgba(233, 198, 108, .45), var(--lift); animation: mergepulse 1.4s ease-in-out infinite; }
.ucard.merge .own i.new { background: var(--brass-hi); border-style: solid; }
.ucard .lvup { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 2px; padding: 1px 0; background: var(--brass-hi); color: var(--ink); font-family: var(--pixel); font-size: 13px; line-height: 1.2; }
.ucard .lvup b { width: 10px; height: 10px; background: var(--ink); clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 60%, 80% 100%, 50% 77%, 20% 100%, 30% 60%, 0 38%, 38% 35%); }
.ucard.merge .uab { margin-bottom: 14px; }
@keyframes mergepulse { 50% { box-shadow: inset 0 0 0 2px var(--brass-hi), 0 0 22px rgba(233, 198, 108, .75), var(--lift); } }
.ucard:hover:not(.no) { transform: translateY(-2px); background: var(--card3); }
.ucard:active:not(.no) { transform: translateY(1px); }
.ucard.no { opacity: .5; }
.ucard.empty { background: rgba(255, 255, 255, .02); border: 1px dashed rgba(233, 198, 108, .25); box-shadow: none; }
.sellzone { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; background: rgba(122, 34, 25, .93); color: var(--text); font-family: var(--pixel); font-size: 28px; border-top: 2px solid var(--foe); pointer-events: none; }
.sellzone.hot { background: var(--foe); }

/* ---------- unit card (hover / tap) */
.info { position: fixed; z-index: 30; width: 340px; max-width: 94vw; color: var(--text); border: 2px solid var(--brass2); border-radius: 10px; box-shadow: 0 0 0 2px var(--ink), 0 6px 0 2px var(--ink), 0 14px 30px rgba(0, 0, 0, .5); padding: 13px 15px; pointer-events: auto; user-select: text; }
.info.sheet { left: 50% !important; transform: translateX(-50%); bottom: 12px; top: auto !important; width: min(440px, 96vw); max-height: 70vh; overflow: auto; }
.info .ih { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; }
.info .port { width: 56px; height: 56px; border-radius: 6px; border: 1px solid var(--ink); background: var(--well) center / cover no-repeat; }
.info .in { font-family: var(--display); font-weight: 900; font-size: 21px; line-height: 1.05; display: block; color: var(--brass-hi); }
.info .in.foe { color: #ff9a8a; }
.info .istar { display: inline-flex; gap: 2px; vertical-align: 2px; margin-left: 2px; }
.info .istar i { width: 12px; height: 12px; background: var(--brass-hi); clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 60%, 80% 100%, 50% 77%, 20% 100%, 30% 60%, 0 38%, 38% 35%); }
.info .itr { display: flex; gap: 4px; align-items: center; font-size: 14px; color: var(--mute); margin-top: 4px; flex-wrap: wrap; }
.info .itr .ti { width: 17px; height: 17px; border-radius: 3px; }
.info .icost { font-family: var(--pixel); font-size: 22px; line-height: 1; display: inline-flex; align-items: center; align-self: start; color: var(--brass-hi); }
.info .istats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 10px; margin: 11px 0 6px; }
.info .istats div { display: flex; justify-content: space-between; font-size: 14px; border-bottom: 1px dashed rgba(170, 179, 198, .25); }
.info dt { color: var(--mute); font-weight: 500; } .info dd { margin: 0; font-variant-numeric: tabular-nums; }
.info .icopies { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; margin: 9px 0 0; font-size: 14px; color: var(--brass-hi); font-weight: 500; }
.info .icopies i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--ink); background: rgba(255, 255, 255, .12); }
.info .icopies i.on { background: var(--you); }
.info .iab { font-family: var(--display); font-weight: 900; font-size: 17px; margin: 11px 0 3px; color: var(--you); }
.info .itext { font-size: 15px; line-height: 1.42; margin: 4px 0 0; font-weight: 500; }
.info .itext b { color: var(--brass-hi); font-weight: 800; }
.info .iact { margin-top: 10px; display: flex; justify-content: flex-end; }
.info .ihint { margin: 8px 0 0; font-size: 13px; color: var(--mute); text-align: right; font-weight: 500; }

.tip { position: fixed; z-index: 31; width: 300px; color: var(--text); border: 2px solid var(--brass2); border-radius: 10px; box-shadow: 0 0 0 2px var(--ink), 0 5px 0 2px var(--ink); padding: 11px 13px; pointer-events: none; font-size: 14px; }
.tip .tt { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 900; font-size: 19px; color: var(--brass-hi); }
.tip .tt .tic { width: 28px; height: 28px; border-radius: 4px; }
.tip .tk { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--mute); }
.tip .tb { margin: 4px 0 0; color: var(--mute); font-weight: 500; }
.tip ul { margin: 6px 0 0; padding: 0; list-style: none; }
.tip li { padding: 3px 0; color: var(--mute); line-height: 1.35; font-weight: 500; }
.tip li.on { color: var(--text); font-weight: 700; }
.tip li b { color: var(--you); }
.tip .tu { margin: 6px 0 0; font-size: 13px; color: var(--mute); font-weight: 500; }

/* ---------- banner, toast */
.banner { position: absolute; left: 50%; top: 28%; transform: translate(-50%, -50%); z-index: 6; border: 2px solid var(--brass); border-radius: 10px; box-shadow: 0 0 0 2px var(--ink), 0 6px 0 2px var(--ink), 0 14px 30px rgba(0, 0, 0, .4); padding: 12px 30px 11px; font-family: var(--display); font-weight: 900; font-size: 36px; color: var(--brass-hi); text-align: center; pointer-events: none; animation: pop .4s cubic-bezier(.16, 1, .3, 1); white-space: nowrap; }
.banner small { display: block; font-family: var(--body); font-weight: 700; font-size: 17px; color: var(--text); margin-top: 3px; white-space: normal; max-width: 460px; }
.banner.bad { border-color: var(--foe); color: #ff9a8a; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.85); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.toast { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 7; background: var(--well); color: var(--text); border: 1px solid var(--brass2); border-radius: 8px; padding: 8px 15px; font-size: 15px; pointer-events: none; max-width: 92%; text-align: center; box-shadow: var(--lift); }

/* ---------- title */
.title-screen { background: linear-gradient(180deg, rgba(10, 12, 20, .05), rgba(10, 12, 20, .55)); }
.card.title { text-align: center; padding: 24px 32px 22px; }
.logo { font-family: var(--display); font-weight: 900; font-size: clamp(52px, 8vw, 84px); line-height: .95; margin: 0; letter-spacing: .04em; color: var(--brass-hi); text-shadow: 0 3px 0 var(--brass2), 0 6px 0 var(--ink), 0 0 30px rgba(233, 198, 108, .25); }
.tag { margin: 10px 0 0; color: var(--text); font-weight: 500; font-size: 17px; }
.titlemenu, .pausesettings { --vm-accent: var(--brass); --vm-gap: 10px; --vm-muted: var(--mute); --vm-danger: #ff9a8a; }
.titlemenu { --vm-width: 330px; margin-top: 16px; }
.titlemenu[data-vm-view="load"], .titlemenu[data-vm-view="replace"] { --vm-width: 440px; }
.titlemenu .btn { font-size: 21px; padding: 8px 16px 7px; }
.vm-menu .btn .vm-sub { font-family: var(--body); font-weight: 500; font-size: 14px; letter-spacing: 0; color: var(--mute); opacity: 1; }
.vm-menu a.btn { color: var(--text); }
.vm-menu .vm-list [data-vm="continue"]:not([disabled]),
.vm-menu .vm-list:has([data-vm="continue"][disabled]) [data-vm="new"] { background: var(--brass); color: var(--ink); }
.vm-menu .vm-list [data-vm="continue"]:not([disabled]) .vm-sub,
.vm-menu .vm-list:has([data-vm="continue"][disabled]) [data-vm="new"] .vm-sub { color: #3a2a10; }
.vm-menu .vm-h { font-family: var(--display); font-weight: 900; font-size: 26px; color: var(--brass-hi); }
.vm-menu .vm-note a { color: var(--brass-hi); }
.vm-menu .vm-slot-btn .vm-label { font-size: 20px; }
.vm-menu .vm-del { font-family: var(--pixel); border: 2px solid currentColor; border-radius: 8px; background: var(--card3); }
.vm-menu .vm-slider label, .vm-menu .vm-slider output { font-family: var(--pixel); font-size: 20px; }
.vm-menu .vm-credits .vm-maker { font-family: var(--display); font-weight: 900; font-size: 28px; color: var(--brass-hi); }
.vm-menu .vm-credits .vm-role { color: var(--mute); }
.pausesettings .vm-panel { max-width: 340px; margin: 0 auto; }

/* ---------- setup, how */
.setrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.setrow .lbl { width: 100px; font-family: var(--display); font-weight: 900; font-size: 19px; color: var(--brass-hi); }
.setrow button { padding: 8px 16px 7px; border: 2px solid var(--ink); border-radius: 8px; background: var(--card3); color: var(--text); box-shadow: var(--lift); font-weight: 800; font-size: 16px; }
.setrow button[aria-checked="true"] { background: var(--you); color: var(--ink); }
.how { margin: 0; padding-left: 20px; line-height: 1.5; font-weight: 500; font-size: 16.5px; max-width: 72ch; }
.how li { margin: 7px 0; }
.how b { color: var(--brass-hi); font-weight: 800; }

/* ---------- end */
.place { font-family: var(--num); font-weight: 700; font-weight: 700; font-size: 80px; line-height: .9; margin: 0; text-align: center; color: var(--brass-hi); text-shadow: 0 4px 0 var(--ink); }
#scrEnd h2 { text-align: center; }
#scrEnd .sub { text-align: center; }
.stats { list-style: none; padding: 0; margin: 10px 0 0; }
.stats li { display: flex; justify-content: space-between; gap: 20px; padding: 6px 0; border-bottom: 1px dashed rgba(170, 179, 198, .25); font-weight: 500; }
.stats b { font-variant-numeric: tabular-nums; color: var(--brass-hi); font-weight: 800; }

/* ---------- misc */
.loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--ink); color: var(--text); font-family: var(--display); font-weight: 900; font-size: 28px; z-index: 50; }
.portrait-hint { display: none; }
.legal { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 14px; justify-content: center; font-size: 12px; padding: 2px; z-index: 5; pointer-events: none; }
.legal a { color: rgba(243, 234, 214, .65); pointer-events: auto; text-decoration: none; }
body.ingame .legal { justify-content: flex-end; padding-right: 12px; }
/* (2026-10-13: footer on the main menu only) */
body:has(#scrTitle[hidden]) .legal { display: none; }

/* ---------- race and class chart */
.card.synchart { max-width: min(1080px, 97vw); }
.synbody { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.syncol h3 { font-size: 24px; margin: 0; }
.syncol .sub { margin-bottom: 8px; font-size: 15px; }
.syn { padding: 9px 11px 10px; margin-bottom: 8px; background: var(--card2); border: 1px solid #34425f; border-radius: 8px; }
.syn.on { border-color: var(--you); box-shadow: inset 0 0 0 1px var(--you); }
.syn.focus { outline: 2px solid var(--brass-hi); }
.synhead { display: flex; align-items: center; gap: 8px; }
.synhead .tic { width: 32px; height: 32px; border: 1px solid var(--ink); border-radius: 6px; flex: none; }
.synhead b { font-family: var(--display); font-weight: 900; font-size: 19px; line-height: 1; color: var(--brass-hi); }
.syncount { font-family: var(--num); font-weight: 700; font-size: 17px; color: var(--text); background: var(--well); border-radius: 4px; padding: 1px 6px; }
.synsteps { margin-left: auto; display: flex; gap: 4px; }
.synsteps i { font-style: normal; font-family: var(--pixel); font-size: 15px; line-height: 1; padding: 3px 7px 2px; border-radius: 4px; background: rgba(255, 255, 255, .07); color: var(--mute); }
.synsteps i.on { background: var(--you); color: var(--ink); }
.synblurb { margin: 5px 0 4px; font-size: 14.5px; color: var(--mute); font-weight: 500; }
.syntiers { list-style: none; margin: 0; padding: 0; font-size: 14.5px; line-height: 1.38; font-weight: 500; }
.syntiers li { display: flex; gap: 7px; color: var(--mute); margin: 3px 0; }
.syntiers li b { flex: none; min-width: 22px; text-align: center; font-family: var(--num); font-weight: 700; font-size: 14px; line-height: 1.4; color: var(--text); background: rgba(255, 255, 255, .07); border-radius: 4px; }
.syntiers li.on { color: var(--text); font-weight: 700; }
.syntiers li.on b { background: var(--you); color: var(--ink); }
.synunits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sport { display: flex; flex-direction: column; align-items: center; width: 60px; font-style: normal; }
.sport .port { width: 44px; height: 44px; border-radius: 6px; border: 2px solid var(--cc, var(--c1)); background: var(--well) center / cover no-repeat; opacity: .8; }
.sport em { font-style: normal; font-size: 11.5px; color: var(--mute); text-align: center; line-height: 1.1; margin-top: 2px; }
.sport.c1 { --cc: var(--c1); } .sport.c2 { --cc: var(--c2); } .sport.c3 { --cc: var(--c3); } .sport.c4 { --cc: var(--c4); } .sport.c5 { --cc: var(--c5); }
.sport.own .port, .sport.field .port { opacity: 1; }
.sport.field .port { box-shadow: 0 0 0 2px var(--you); }
.sport.field em, .sport.own em { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .ucard.merge { animation: none; }
  .banner { animation: none; }
  .ucard, .btn { transition: none; }
}

/* ---------- smaller screens */
@media (max-width: 1100px) {
  .app { grid-template-columns: 180px minmax(0, 1fr) 170px; }
  .ucard { grid-template-columns: 44px 1fr; }
  .ucard .port { width: 44px; height: 44px; }
  .ucard .un { font-size: 13.5px; }
  .groundchip .gl { display: none; }
}
@media (max-height: 560px), (max-width: 820px) {
  .app { grid-template-columns: 58px minmax(0, 1fr) 96px; }
  .top { padding: 4px 8px; gap: 6px; }
  .roundbox { font-size: 20px; } .roundbox .lbl { font-size: 12px; }
  .phase { display: none; }
  .groundchip { padding: 2px 8px; } .groundchip b { font-size: 13px; }
  .stat { font-size: 19px; padding: 3px 8px 2px; }
  .heart { transform: scale(.8); }
  .stat .coin { width: 13px; height: 13px; }
  .xpbar { width: 40px; }
  .stat small { display: none; }
  .sq { width: 32px; height: 32px; font-size: 16px; }
  .traits, .players { padding: 6px; }
  .traits h3 { display: none; }
  .trhead { justify-content: center; margin-bottom: 4px; }
  .chartbtn { font-size: 12px; padding: 3px 5px 2px; }
  .synbody { grid-template-columns: 1fr; }
  .syntiers { font-size: 13px; }
  .sport { width: 48px; } .sport .port { width: 36px; height: 36px; }
  .ucard .lvup { font-size: 10px; }
  .ucard.merge .uab { margin-bottom: 0; }
  .players h3 { font-size: 13px; margin-bottom: 4px; }
  .trait { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 3px 2px 2px; margin-bottom: 4px; }
  .trait .tic { width: 28px; height: 28px; }
  .trait .tn, .trait .tsteps { display: none; }
  .trait .tc { font-size: 14px; line-height: 1; }
  .traits .empty { font-size: 11px; }
  .pl { grid-template-columns: 22px 1fr; grid-template-rows: auto; padding: 2px 4px; margin-bottom: 3px; column-gap: 5px; }
  .pl .pp { grid-row: auto; width: 22px; height: 22px; border-radius: 4px; }
  .pl .pn, .pl .plv { display: none; }
  .pl .ph { grid-column: 2; font-size: 14px; gap: 4px; }
  .pl .hb { height: 5px; }
  .shopbar { padding: 6px 8px 6px; gap: 6px; }
  .shopbar::before { display: none; }
  .shopleft, .shopright { gap: 5px; }
  .btn.buy { min-width: 70px; font-size: 16px; padding: 5px 7px 4px; flex-direction: row; gap: 5px; }
  .btn.buy .price { font-size: 12px; }
  .btn.lock { font-size: 15px; padding: 4px 8px 3px; }
  .btn.fight { font-size: 21px; padding: 7px 10px 6px; min-width: 84px; }
  .cards { gap: 5px; }
  .ucard { grid-template-columns: 30px 1fr; grid-template-rows: auto auto; padding: 5px 5px 3px; column-gap: 5px; border-radius: 7px; }
  .ucard .port { display: block; grid-row: 1 / 3; width: 30px; height: 30px; border-radius: 5px; }
  .ucard .un { font-size: 11.5px; padding: 3px 22px 0 0; }
  .ucard .ut { font-size: 11px; }
  .ucard .ti { width: 12px; height: 12px; }
  .ucard .ut + .ut, .ucard .uab, .ucard .own { display: none; }
  .ucard .uc { font-size: 16px; top: 5px; right: 5px; }
  .ucard:not(.empty) { padding-top: 13px; }
  .ucard .urar { font-size: 8.5px; padding: 0 5px 1px 4px; border-bottom-right-radius: 5px; }
  .ucard .uc { top: 3px; }
  .card { padding: 15px 17px; outline-offset: -6px; }
  .card h2 { font-size: 24px; }
  .banner { font-size: 26px; padding: 8px 18px 7px; }
  .banner small { font-size: 14px; }
  .titlemenu { --vm-width: 520px; --vm-gap: 7px; margin-top: 8px; }
  .titlemenu .vm-list { display: grid; grid-template-columns: 1fr 1fr; }
  .card.title { padding: 12px 18px 12px; }
  .logo { font-size: 40px; }
  .tag { font-size: 14px; margin-top: 4px; }
  .title-screen { align-items: flex-start; }
  .card { max-height: calc(100dvh - 24px); }
  body.ingame .legal { display: none; }
  .info.sheet { max-height: 90vh; bottom: 6px; padding: 9px 12px; }
  .info .istats { margin: 6px 0 2px; }
  .info .iab { margin: 6px 0 3px; font-size: 15px; }
  .info .itext { font-size: 13.5px; margin-top: 4px; }
}
body.upright.ingame .portrait-hint { display: flex; position: fixed; inset: 0; z-index: 70; background: rgba(10, 12, 20, .93); color: var(--text); align-items: center; justify-content: center; text-align: center; padding: 30px; font-family: var(--display); font-weight: 900; font-size: 24px; }

/* role line on the unit card: Tank, DPS, Archer, Mage, Healer, Assassin + melee or ranged */
.info .ijob { margin: 8px 0 2px; font-size: 14px; line-height: 1.35; color: var(--mute); }
.info .ijob b { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 4px; background: rgba(255, 255, 255, .1); color: var(--text); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.info .ijob .ireach { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .18); color: var(--text); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
@media (max-height: 560px), (max-width: 820px) { .ucard .ujob { display: none; } }

/* the heart takes a hit after a lost fight */
.stat.hp { position: relative; }
.stat.hp.struck { animation: hpshake .5s cubic-bezier(.36, .07, .19, .97) .1s both, hpflash 1s ease-out .1s both; }
.stat.hp.struck > :first-child { animation: hppulse .6s ease-out .1s both; }
@keyframes hpshake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@keyframes hpflash { 0% { background: #c8322a; box-shadow: 0 0 22px rgba(255, 70, 50, .85); } 100% { box-shadow: 0 0 0 rgba(255, 70, 50, 0); } }
@keyframes hppulse { 0% { transform: scale(1); filter: brightness(3); } 30% { transform: scale(1.5); } 100% { transform: scale(1); filter: none; } }
.hpslash { position: absolute; left: 2px; top: -6px; width: 34px; height: 40px; pointer-events: none; z-index: 3; }
.hpslash i { position: absolute; left: -6px; width: 46px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 40%, #ffe7a8 70%, rgba(255, 255, 255, 0)); box-shadow: 0 0 8px #ffb08a; transform-origin: left center; transform: rotate(-38deg) scaleX(0); animation: hpcut .42s ease-out both; }
.hpslash i:nth-child(1) { top: 26px; }
.hpslash i:nth-child(2) { top: 33px; animation-delay: .06s; }
.hpslash i:nth-child(3) { top: 40px; animation-delay: .12s; }
@keyframes hpcut { 0% { transform: rotate(-38deg) scaleX(0); opacity: 1; } 55% { transform: rotate(-38deg) scaleX(1); opacity: 1; } 100% { transform: rotate(-38deg) scaleX(1); opacity: 0; } }
.hpdrop { position: absolute; right: 6px; top: 100%; pointer-events: none; z-index: 3; color: #ff5a4a; font-size: 26px; text-shadow: 0 2px 0 #12100c, 0 0 10px rgba(255, 60, 40, .7); animation: hpdrop 1.4s ease-out .15s both; }
@keyframes hpdrop { 0% { transform: translateY(-14px) scale(1.4); opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { transform: translateY(22px) scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .stat.hp.struck, .stat.hp.struck > :first-child { animation: hpflash 1s ease-out both; } .hpslash { display: none; } }

.info .igrow { margin: 4px 0 0; font-size: 13px; line-height: 1.35; color: var(--c5); }

.info .ipool { margin: 6px 0 0; font-size: 13px; line-height: 1.35; color: var(--mute); }
.info .ipool b { color: var(--text); }

/* numbers use Rubik: easier to read than the pixel face (2026-10-03) */
.stat b, .roundbox b, .pl .ph b { font-variant-numeric: tabular-nums; letter-spacing: 0; }
/* win streak flames next to a warlord */
.fire { display: inline-flex; align-items: flex-end; gap: 1px; height: 16px; }
.fire i { width: 8px; height: 13px; background: radial-gradient(ellipse at 50% 80%, #fff3b0 0 18%, #ffb238 35%, #ff5a1f 62%, rgba(255, 60, 20, 0) 72%); clip-path: path("M4 0 C6 3 8 5 8 8.5 C8 11 6.2 13 4 13 C1.8 13 0 11 0 8.5 C0 6.5 1.5 5 2.4 3.6 C2.6 5 3.2 5.8 4 6 C4.4 4 4.5 2 4 0 Z"); transform-origin: 50% 100%; animation: flick .5s ease-in-out infinite alternate; filter: drop-shadow(0 0 3px rgba(255, 120, 40, .8)); }
.fire i:nth-child(2) { animation-delay: .17s; height: 15px; }
.fire i:nth-child(3) { animation-delay: .33s; }
.fire b { margin-left: 3px; font-family: var(--num); font-size: 12px; font-weight: 800; color: #ffb238; line-height: 1; }
@keyframes flick { 0% { transform: scale(.9, .95) skewX(-4deg); } 100% { transform: scale(1.05, 1.08) skewX(5deg); } }
/* the warlord you fight next */
.pl.next { border-color: #ffb238; box-shadow: 0 0 0 1px #ffb238, 0 0 12px rgba(255, 178, 56, .45); animation: nextpulse 1.6s ease-in-out infinite; }
.pl .pn em.nx { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #12100c; background: #ffb238; border-radius: 3px; padding: 1px 5px; margin-left: 4px; }
@keyframes nextpulse { 50% { box-shadow: 0 0 0 1px #ffb238, 0 0 20px rgba(255, 178, 56, .7); } }
.nextmon { margin: 0 0 6px; padding: 4px 8px; border: 1px solid #ffb238; border-radius: 6px; font-size: 13px; color: var(--mute); }
.nextmon b { color: #ffb238; }
@media (prefers-reduced-motion: reduce) { .fire i, .pl.next { animation: none; } }

.pl .plv { white-space: nowrap; }

/* rivals are bots for now (multiplayer comes later) */
.pl .pn .bot { font-style: normal; font-weight: 600; font-size: .82em; color: #9aa3b5; opacity: .8; }

/* vm-mute room (2026-10-04): the site-wide mute button from /assets/menu.js sits in the top right corner. */
.top{padding-right:62px}

/* the first-game guide (coach.js, 2026-10-15): one card at a time, pointing at one thing */
.coach { position: fixed; z-index: 15; width: min(330px, calc(100vw - 28px)); padding: 11px 14px 12px; color: var(--text); background: var(--card2); border: 2px solid var(--brass, var(--gold)); border-radius: var(--r); box-shadow: 0 0 0 2px var(--ink), 0 6px 0 2px var(--ink), 0 14px 30px rgba(0, 0, 0, .5); font-family: var(--body); }
.coach[hidden] { display: none; }
.coach-k { margin: 0 0 2px; font: 700 11.5px/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.coach-t { margin: 0 0 5px; font-family: var(--display); font-size: 19px; line-height: 1.15; color: var(--brass-hi, var(--gold-hi)); }
.coach-p { margin: 0; font-size: 15px; line-height: 1.4; font-weight: 600; }
.coach-b { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.coach-b [hidden] { display: none; }
.coach-skip { margin-left: auto; padding: 4px 0; background: none; border: 0; color: var(--mute); font: 600 13px var(--body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.coach-skip:hover, .coach-skip:focus-visible { color: var(--text); }
.coach-arrow { position: absolute; display: none; width: 14px; height: 14px; background: var(--card2); border: 2px solid var(--brass, var(--gold)); transform: rotate(45deg); }
.coach[data-dir="down"] .coach-arrow { display: block; bottom: -9px; border-top: 0; border-left: 0; }
.coach[data-dir="up"] .coach-arrow { display: block; top: -9px; border-bottom: 0; border-right: 0; }
.coach[data-dir="left"] .coach-arrow { display: block; left: -9px; border-top: 0; border-right: 0; }
.coach[data-dir="right"] .coach-arrow { display: block; right: -9px; border-bottom: 0; border-left: 0; }
.coach-hl { outline: 3px solid var(--brass-hi, var(--gold-hi)); outline-offset: 3px; animation: coachPulse 1.4s ease-in-out infinite; }
@keyframes coachPulse { 50% { outline-color: transparent; } }
.coach-board { position: fixed; inset: 0; z-index: 2; display: none; width: 100vw; height: 100vh; pointer-events: none; color: var(--you, var(--venom)); }
.coach-board.on { display: block; }
.coach-board polygon { fill: currentColor; fill-opacity: .16; stroke: none; }
.coach-board polyline { fill: none; stroke: var(--brass-hi, var(--gold-hi)); stroke-width: 3; stroke-dasharray: 10 7; animation: coachDash 1s linear infinite; }
@keyframes coachDash { to { stroke-dashoffset: -17; } }
@media (prefers-reduced-motion: reduce) { .coach-hl, .coach-board polyline { animation: none; } }

/* Drafting table and battlefield layout. */
.players { grid-area: 2 / 1 / 3 / 2; padding: 12px; background: rgba(18, 16, 12, .65); }
.traits { grid-area: 2 / 3 / 3 / 4; padding: 12px; background: rgba(18, 16, 12, .65); }
.players .roundbox { flex-wrap: wrap; margin: 0 0 16px; gap: 6px; }
.players .phase { font-size: 11px; letter-spacing: 0; margin-left: 0; }
#btnFight { position: absolute; z-index: 5; transform: translateX(-50%); min-width: 116px; font-size: 24px; padding: 8px 20px; }
.cards { grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 8px; overflow-x: auto; padding: 3px 2px 7px; }
.ucard, .ucard:not(.empty) { display: flex; flex-direction: column; align-items: stretch; padding: 8px; min-height: 194px; border-radius: 5px; gap: 3px; }
.ucard .cardtraits { display: flex; flex-direction: column; gap: 2px; min-height: 34px; padding-right: 20px; text-align: left; color: var(--text); font-size: 12px; line-height: 1.2; }
.cardtraits > span { display: flex; align-items: center; gap: 4px; }
.ucard .port { align-self: center; width: 74px; height: 74px; border: 0; border-radius: 2px; background-color: var(--well); }
.ucard .un { display: block; font-size: 12px; line-height: 1.2; padding: 3px 0 0; min-height: 31px; text-align: center; }
.ucard .urar { align-self: center; background: none; color: var(--cc); font-size: 11px; letter-spacing: 0; text-transform: none; padding: 0; }
.ucard .uab { margin-top: auto; font-size: 12px; padding: 2px 4px; text-align: center; }
.ucard .uc { top: 8px; right: 6px; font-size: 17px; }
.ucard .own { top: 56px; right: 8px; flex-direction: column; }
.ucard.no { opacity: .72; }
.economy-tip { width: min(460px, calc(100vw - 12px)); max-height: calc(100vh - 12px); overflow: auto; pointer-events: auto; }
.economy-tip p { font-size: 15px; line-height: 1.35; margin: 8px 0; }
.economy-tip table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 12px; }
.economy-tip caption { text-align: left; padding-bottom: 6px; color: var(--brass-hi); }
.economy-tip th, .economy-tip td { padding: 4px; text-align: right; }
.economy-tip th:first-child { text-align: left; }
.economy-tip .current { background: var(--card3); color: var(--brass-hi); }
@media (max-width: 1100px) { .cards { grid-template-columns: repeat(7, minmax(94px, 1fr)); } }
@media (max-height: 560px), (max-width: 820px) {
  .app { grid-template-columns: 96px minmax(0, 1fr) 58px; }
  .players, .traits { padding: 6px; }
  .players .roundbox { font-size: 20px; margin-bottom: 6px; }
  .players .roundbox .lbl { font-size: 11px; }
  .players .phase { display: block; font-size: 10px; padding: 2px 4px; }
  #btnFight { font-size: 18px; min-width: 86px; padding: 5px 10px; }
  .cards { grid-template-columns: repeat(7, minmax(80px, 1fr)); gap: 4px; padding-bottom: 4px; }
  .ucard, .ucard:not(.empty) { min-height: 108px; padding: 5px; gap: 1px; }
  .ucard .cardtraits { min-height: 24px; font-size: 10px; padding-right: 14px; }
  .ucard .ti { width: 10px; height: 10px; flex: none; }
  .ucard .port { width: 36px; height: 36px; }
  .ucard .un { font-size: 10px; min-height: 24px; padding: 0; }
  .ucard .urar { font-size: 10px; }
  .ucard .uc { top: 5px; right: 4px; font-size: 13px; }
  .ucard .uc .coin { display: none; }
  .ucard .uab { display: none; }
  .groundchip { display: none; }
}
