/*
 * The game's card (src/GameCard.php), drawn as the game's deck builder does.
 *
 * Its own stylesheet, so that one set of numbers serves every page that draws
 * a card: the public guild page (linked after site.css when pageOpen() is
 * given $ctx['game_card']) and the developer panel's Cards tab (linked after
 * panel.css). Nothing here styles anything but a .game-card and what it holds,
 * and nothing here depends on the stylesheet of the page: the font and the
 * hidden cost text are declared again here.
 */

/* Fraunces, SIL Open Font License: see fonts/OFL-*.txt. The same files as site.css: a browser fetches them once. */
@font-face {
  font-family: 'Fraunces'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(fonts/fraunces-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(fonts/fraunces-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

.game-card { --card-serif: 'Fraunces', Georgia, serif; }
.game-card .visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/*
 * Game card (src/GameCard.php): the game's card, from the exported pieces.
 *
 * The card is 115 by 184 units, as CardUI.prefab of the game, and one unit is
 * the font size of .game-card: every length below is in em, so --card-unit
 * alone sets the size of a card. Each piece is where the prefab puts it, with
 * the scale of its parents applied; the object it comes from is named beside
 * it. Texts are set on an inner element, because their own em is their size.
 * The game shrinks a text until it fits (auto-size); here it takes one of the
 * sizes .gc-fit-1 to 4 from its length, and is cut beyond that. The deck counter
 * of the prefab (DeckCounter) is not drawn: a page has no deck to count.
 */

.game-card {
  position: relative; flex: none; width: 115em; height: 184em; margin: 2em 4em 0;
  font-size: var(--card-unit, 2px); line-height: 1; color: #241b1b; text-align: center;
}
.game-card > * { position: absolute; margin: 0; }
.game-card .game-img { display: block; }
/* Plain parchment under the body, inside its outline: the texts stay readable while the body loads, or without it */
.game-card::before { content: ''; position: absolute; left: 4em; top: 7em; right: 4em; bottom: 7em; border-radius: 2em; background: #ecd7b4; }
.gc-plain::before { left: 0; top: 0; right: 0; bottom: 0; border: 1em solid #b98a5c; border-radius: 5em; }
.gc-plate { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }

/* Background: the body of the card's type, stretched to the card and turned upside down, as in the prefab */
.gc-body { left: 0; top: 0; width: 115em; height: 184em; transform: rotate(180deg); }
/* Illustration > IllustrationImage: 100 by 100 at scale 0.8, aspect kept */
.gc-art { left: 17.5em; top: 19.4em; width: 80em; height: 80em; }
.gc-art .game-img { width: 100%; height: 100%; object-fit: contain; }
/* The illustration the image index lacks: a box drawn in its place */
.gc-art .game-img-none { box-sizing: border-box; border: 1px dashed #b98a5c; border-radius: 3em; background: rgba(120, 80, 50, 0.12); }
/* IllustrationFrame: stretched, over the illustration */
.gc-art-frame { left: 8.2em; top: 15.7em; width: 98.6em; height: 87.4em; }
/* TypeFrame, TypeText: bold small caps 5.95 */
.gc-type { left: 37.5em; top: 96.4em; width: 39.9em; height: 7.7em; display: flex; align-items: center; justify-content: center; }
.gc-type-text { position: relative; font-size: 5.6em; font-weight: 600; font-variant: small-caps; letter-spacing: 0.04em; color: #1a0923; white-space: nowrap; }
/* NameFrame, NameText: bold, 10.3 down to 6 */
.gc-name { left: 2.5em; top: 101.5em; width: 110em; height: 15em; display: flex; align-items: center; justify-content: center; }
.gc-name-text { position: relative; max-width: 78%; margin: 0; font-family: var(--card-serif); font-weight: 600; font-size: 10.3em; line-height: 1.25; color: #1a0923; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-name-text.gc-fit-2 { font-size: 8.4em; }
.gc-name-text.gc-fit-3 { font-size: 7em; }
.gc-name-text.gc-fit-4 { font-size: 6em; }
/* DescriptionText: centred both ways, 8 down to 6.2 */
.gc-text { left: 5.8em; top: 119.6em; width: 103.5em; height: 42.3em; box-sizing: border-box; padding: 0 3em; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gc-text-in { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; font-size: 8em; line-height: 1.16; text-wrap: balance; }
.gc-text-in.gc-fit-2 { font-size: 7em; }
.gc-text-in.gc-fit-3 { font-size: 6.2em; -webkit-line-clamp: 5; }
.gc-text strong { font-weight: 600; color: #1a0923; }
/* CostBubble > ApCostBubble (flipped top to bottom in the prefab), HpCostBubble (32.2 by 25 at scale 1.2) */
.gc-cost { left: -4.5em; top: -1.4em; width: 32em; height: 32em; }
.gc-cost-ap .gc-plate { transform: scaleY(-1); }
.gc-cost-hp { left: -7.9em; top: -0.9em; width: 38.6em; height: 30em; }
/* ApCostText: bold 17, the same over both gems */
.gc-cost-text { left: -3.7em; top: 0.8em; width: 30em; height: 30em; display: flex; align-items: center; justify-content: center; }
/* the AP gem is flipped, so its stone sits higher than the HP one: the number goes up with it */
.gc-cost-text-ap { top: -1em; }
.gc-cost-text > span:first-child { font-family: var(--card-serif); font-size: 17em; font-weight: 600; color: #befcff; text-shadow: 0 0 0.14em #06303c, 0 0.04em 0.1em #06303c; }
/* Exhaust > ExhaustImage: 24 by 24, centred 46.82 right of and 77.44 above the card's centre; drawn after CostBubble, over the illustration frame */
.gc-exhaust { left: 92.3em; top: 2.6em; width: 24em; height: 24em; }
