/* Banners of Asgard website: the cards page's cost runes, level 1 numbers and level calculator
   (S734, tools/site_cards.py). Colours and type are site.css's tokens (the game's Kit). */

/* The tile: the cost on the game's lit cost rune (the artist), the whole tile opens the card. */
.card-tile { position: relative; }
.card-cost {
  display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem;
  background: url("/assets/cards/cost-rune.webp") center / contain no-repeat;
  font: 700 1.25rem/1 var(--display); color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(79, 163, 230, .8);
}
.card-tile > .card-cost { position: absolute; top: .35rem; left: .35rem; z-index: 1; }
a.card-name { text-decoration: none; }
a.card-name::after { content: ""; position: absolute; inset: 0; border-radius: 8px; }
a.card-name:focus-visible { outline: none; }
a.card-name:focus-visible::after { outline: 3px solid var(--fire); outline-offset: -3px; }
.card-tile:hover { border-color: var(--fire); }
/* the numbers could not be fetched (S865): a short line under the name; the next click fetches again */
.card-error { margin: .3rem .6rem 0; padding: .3rem .45rem; font-size: .85rem; line-height: 1.3; color: var(--text); background: rgba(16, 13, 10, .85); border-left: 3px solid var(--fire); }
.card-lv1 { display: flex; flex-wrap: wrap; gap: 0 .6rem; margin: 0; padding: .15rem .6rem .35rem; font-size: .85rem; }
.card-lv1 dt { color: var(--muted); }
.card-lv1 dd { margin: 0 .2rem 0 .3rem; color: var(--text); font-weight: 700; }
.card-lv1 dt, .card-lv1 dd { display: inline; }

/* The line above the grid that says a card opens its levels (S967, note 401): the page's hint face (.fine), in gold
   with a rune-coloured edge so it is seen before the first tile; hidden until site-cards.js knows the panel works. */
.cards-hint-block { padding-top: 1.2rem; }
.cards-hint { margin: 0; padding: .55rem .8rem; font-size: 1rem; line-height: 1.4; color: var(--gilt-light); background: rgba(16, 13, 10, .6); border-left: 3px solid var(--fire); border-radius: 4px; }
.cards-hint[hidden] { display: none; }

/* The panel. */
.cp {
  width: min(34rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem); padding: 0;
  border: 2px solid var(--common); border-radius: var(--radius); background: var(--leather-dark); color: var(--text);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .7);
}
.cp.rarity-legendary { border-color: var(--legendary); }
.cp.rarity-epic { border-color: var(--epic); }
.cp.rarity-rare { border-color: var(--rare); }
.cp::backdrop { background: rgba(8, 6, 4, .78); }
.cp-inner { position: relative; padding: 1rem; }
.cp-close {
  position: absolute; top: .4rem; right: .4rem; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%;
  background: transparent; color: var(--text); font: 700 1.8rem/1 var(--serif); cursor: pointer;
}
.cp-close:hover { color: var(--fire); }
.cp-top { display: flex; gap: 1rem; align-items: center; padding-right: 2.5rem; }
.cp-img { width: 6.5rem; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; flex: none; }
.cp-head p { margin: 0; }
.cp-kind { color: var(--muted); font-size: .9rem; letter-spacing: .04em; }
.cp-title { font: 700 1.6rem/1.1 var(--display); margin: .2rem 0 .4rem; }
.cp-title.rarity-legendary { color: var(--legendary); }
.cp-title.rarity-epic { color: #c79af0; }
.cp-title.rarity-rare { color: #8fb8f0; }
.cp-cost { display: flex; align-items: center; gap: .4rem; color: var(--muted); }

.cp-level { display: flex; align-items: center; gap: .6rem; margin: 1rem 0 .6rem; }
.cp-mid { flex: 1; display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.cp-label { font: 700 1.05rem/1.2 var(--display); text-align: center; }
.cp-range { width: 100%; accent-color: var(--fire); height: 1.75rem; margin: 0; }
.cp-step {
  flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 2px solid var(--gilt);
  background: var(--leather); color: var(--gilt-light); font: 700 1.4rem/1 var(--serif); cursor: pointer;
}
.cp-step:hover:not(:disabled) { border-color: var(--fire); color: var(--fire); }
.cp-step:disabled { opacity: .35; cursor: default; }

.cp-stats { width: 100%; border-collapse: collapse; font-size: 1rem; }
.cp-stats th { text-align: left; font-weight: 400; color: var(--muted); padding: .3rem 0; }
.cp-stats td { text-align: right; padding: .3rem 0 .3rem .6rem; white-space: nowrap; }
.cp-stats tr + tr { border-top: 1px solid rgba(201, 149, 63, .18); }
.cp-now { font-weight: 700; }
.cp-gain { color: #8fd18a; width: 4.5rem; font-size: .9rem; }
.cp-price { margin: .8rem 0 .2rem; color: var(--gilt-light); }
.cp-spent, .cp-note, .cp-siege { margin: .2rem 0; font-size: .9rem; color: var(--muted); }
.cp-desc { margin: .8rem 0 .4rem; line-height: 1.4; }
.cp-lines { margin: 0 0 .4rem; padding-left: 1.1rem; line-height: 1.35; font-size: .95rem; }
.cp-note { margin-top: .8rem; }
