/* v12.43
   1. Hero select: the double gold/black frame line (#title::before) scrolled with the page and cut across the stone
      background at the side of the panels. It is gone.
   2. Your deck / Your rival / Rival's deck: every pill keeps one height, names wrap to at most two balanced lines
      inside the pill in English and Spanish, crests line up, and the rival portraits sit on an even grid with
      labels that never leave their cell.
   3. Board: servants keep a gap at every board size so stat badges and name plates of neighbours never touch.
   4. Card draw: a card flies out of the deck to the hand (see js/ui.js, drawFly). */

/* ---- 1. no frame line on the hero select ---- */
#title::before{content:none!important;display:none!important}

/* ---- 2. deck and rival panels ---- */
#title .decks{grid-template-columns:minmax(0,1fr) minmax(0,1.12fr) minmax(0,1fr);align-items:stretch}
#title .pnl{display:flex;flex-direction:column;min-width:0}
#title .dk-row,#title .dk-row.dk-mine{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 9px;align-content:start}
#title .dk{
  min-width:0;box-sizing:border-box;height:50px;min-height:50px;padding:4px 12px 4px 6px;gap:9px;
  font:700 16px/1.08 var(--f-body);letter-spacing:.005em;overflow:hidden
}
#title .dk .dkc{width:34px;height:34px;flex:0 0 34px}
#title .dk .dkc .ico{width:19px;height:19px}
#title .dk .dkn{
  flex:1 1 auto;min-width:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;
  white-space:normal;overflow:hidden;overflow-wrap:normal;word-break:normal;hyphens:manual;
  text-wrap:balance;line-height:1.08;max-height:2.2em;text-align:left
}
#title .dk-c .dkn{-webkit-line-clamp:2}
#title .dk .dkn.fit1{font-size:14.5px}
#title .dk .dkn.fit2{font-size:13px;letter-spacing:0}
html.lang-es #title .dk{font-size:15.5px}

/* rival portraits: one even grid, centred last row, two-line label cell for every hero */
#title .rv-row{display:flex;flex-wrap:wrap;justify-content:center;align-content:flex-start;gap:10px 4px;margin-top:2px}
#title .rv{flex:0 0 calc((100% - 16px) / 5);max-width:calc((100% - 16px) / 5);min-width:0;box-sizing:border-box;gap:6px;padding:4px 0 0}
#title .rv .rva{width:52px;height:52px;flex:none}
#title .rv small{
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;
  width:100%;min-height:2.3em;max-height:2.3em;font-size:12.5px;line-height:1.12;padding-bottom:1px;letter-spacing:.01em;
  text-align:center;text-wrap:balance;overflow-wrap:normal;padding:0 2px;box-sizing:border-box
}
#title .rv.on::after{right:calc(50% - 32px);top:0}
#title .rv.dis::after{top:20px}
html.lang-es #title .rv.dis::after{content:"Tú"}
html.lang-es #title .rv small{font-size:12px;letter-spacing:0}

/* phones / adapt layout keep the same rules with a little less padding */
html.adapt #title .dk{height:46px;min-height:46px;font-size:15px;padding:3px 10px 3px 5px}
html.adapt #title .dk .dkc{width:30px;height:30px;flex-basis:30px}
html.adapt #title .rv small{font-size:11.5px;letter-spacing:0}
html.adapt #title .rv .rva{width:46px;height:46px}
/* the v12.38 size lock pins min-widths; inside these even grids the cell width rules */
#title .rv,#title .dk-row .dk{min-width:0!important}

/* v12.43: board spacing - neighbouring servants' stat badges (which overhang the oval by ~11px) and name plates (up to 138px) never overlap.
   1-6 servants: 146px pitch at full size; 7 servants: 129px pitch at scale .89. Keep in sync with ROWP() in js/ui.js. */
html:not(.adapt) .row{gap:34px}
html:not(.adapt) .row[data-n="7"]{gap:17px}
html:not(.adapt) .row[data-n="7"] .tok,html:not(.adapt) .row.n7p .tok{scale:.89}
/* v12.43: circle-token adapt layouts (tablet / portrait): the name plate sits in its own band under the circle, never on top of the stat badges */
html.adapt:not(.compact-land) .tok .tname{top:calc(var(--ad-tok,64px) + 1px);bottom:auto;left:0;right:0;transform:none;min-width:0;max-width:none;width:auto;margin:0;padding:1px 2px;text-align:center}
html.adapt:not(.compact-land) .tok .stat{bottom:2px}
html:not(.adapt) .tok .stat{bottom:17px}

/* v12.43: draw flight - the card back shown on a freshly drawn card until it turns over mid-air (js/ui.js drawFly) */
#hand .card>.drawbk,.flyghost>.drawbk{position:absolute;inset:0;border-radius:inherit;background:#2a0a12 var(--cb) center/cover;box-shadow:inset 0 0 0 2px rgba(207,162,74,.9),inset 0 0 18px rgba(255,214,128,.35);z-index:60;pointer-events:none;opacity:0}
#hand .card.drawing,#rhand .back.drawing{z-index:90}
@media (prefers-reduced-motion:reduce){#hand .card>.drawbk,.flyghost>.drawbk{display:none}}
.flyghost.back{background:#2a0a12 var(--cb) center/cover;border-radius:5px;box-shadow:0 0 0 1px #000,0 0 0 2px rgba(207,162,74,.85)}
.flyghost.back.r{background-image:var(--cbr,var(--cb))}
