/* The card face and the full-card tooltip, exactly as the companion draws them.
   Generated from src/OriginsDeckTracker.Companion/src/styles.css by `mining tooltip`.
   Edit the companion stylesheet, not this file. See README.md in this folder. */

@font-face {
  font-family: "Montserrat";
  src: url("./montserrat-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

:root {
  color-scheme: dark;
  --bg: #0a0f17;
  --panel: #111a27;
  --panel-deep: #0d1520;
  --line: #1e2b3d;
  --text: #e8eef7;
  --muted: #8394ac;
  --gold: #ffc509;
  --local: #46c7a2;
  --opponent: #e0798f;
  --danger: #ff9b9b;
}

.card-face {
  position: relative;
  /* Square tiles (owner decision 2026-10-23): compact enough that three
     columns survive at normal widths and two at the 640-px window floor
     (owner round 5); the hover card keeps all the detail. */
  aspect-ratio: 1 / 1;
  border-radius: 9px;
  border: 1px solid var(--cf-border, #465b77);
  background:
    radial-gradient(120% 74% at 50% 6%, color-mix(in srgb, var(--cf-border, #465b77) 26%, transparent), transparent 70%),
    var(--cf-bg, linear-gradient(168deg, #233247, #1a2536));
  box-shadow: inset 0 0 0 1px rgba(10, 15, 23, 0.4);
  overflow: hidden;
}

/* The real illustration (refinement 14): the plugin's extracted PNG sits under
   the frame's own name band, mana chip and stat badges. The scrim is soft on a
   tile — the art is the point — and stronger on the hover card and the overlay
   plates, where it protects body text drawn straight over the picture. */
.card-face.has-art {
  background-image:
    linear-gradient(180deg, rgba(6, 10, 18, 0.4), rgba(6, 10, 18, 0.02) 38%, rgba(6, 10, 18, 0.5) 90%),
    var(--card-art);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.rarity-common { --cf-border: #4b5f7c; --cf-name: #dfe7f2; }
.rarity-rare   { --cf-border: #4d90c8; --cf-name: #dbeefe; }
.rarity-epic   { --cf-border: #8a5cd6; --cf-name: #e8ddff; }
.rarity-legendary { --cf-border: #d9a83e; --cf-name: #f4d98c; }
.rarity-none   { --cf-border: #46505c; --cf-name: #b9c3cf; }
.rarity-inherit, .rarity-unknown { --cf-border: #46505c; --cf-name: #b9c3cf; }

.type-spell { --cf-bg: linear-gradient(168deg, #182c44, #101a29); }
.type-commander { --cf-bg: linear-gradient(168deg, #2e2718, #1c1a12); }
.type-tower  { --cf-bg: linear-gradient(168deg, #2a2338, #191324); }

.card-face.unknown {
  border-style: dashed;
  opacity: 0.55;
}

/* A hidden card is drawn as a back, never as a face: the app mark on a dark
   plate, at the same square size, so the hand's count stays readable. */
.card-face.card-back {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 44%, #26374f, #101826 74%);
  box-shadow: inset 0 0 0 1px rgba(255, 197, 9, 0.1);
}

.card-back .cb-mark {
  width: 46%;
  height: 46%;
  object-fit: contain;
  opacity: 0.32;
}

/* The live deck no longer holds any copy of this key: the tile dims so the
   spent cards read at a glance (mirrored in the ×N badge going away). */
.card-face.is-spent {
  opacity: 0.45;
  filter: saturate(0.4);
}

/* The local player selected this card to throw in the mulligan, before they
   confirm. A red frame plus a tag, because the decklist is a card-type view and
   the tile still shows its normal count. */
.card-face.is-mulligan {
  outline: 2px solid #e05b5b;
  outline-offset: -2px;
}

.card-face .cf-mulligan {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 1px 5px;
  border-radius: 3px;
  background: #8f2f2f;
  color: #ffe9e9;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.card-face .cf-name {
  position: absolute;
  /* Bottom band sits above the two stat chips (they keep the corners); one
     line of name is the regular case on the square tile, long names clamp. */
  inset: auto 3px 26px;
  padding: 3px 4px;
  border-radius: 5px;
  background: rgba(8, 12, 20, 0.74);
  color: var(--cf-name, #dfe7f2);
  font-size: 10.5px;
  line-height: 1.25;
  font-weight: 600;
  text-align: center;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.card-face.rarity-legendary .cf-name {
  text-shadow: 0 1px 4px rgba(120, 80, 0, 0.4);
}

.card-face .cf-mana {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #2c4265, #101d31);
  box-shadow: inset 0 0 0 1px #63b3e8, 0 1px 4px rgba(0, 0, 0, 0.45);
  color: #9fd4f7;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.card-face .cf-stat {
  position: absolute;
  bottom: 4px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(10, 15, 23, 0.35), 0 1px 4px rgba(0, 0, 0, 0.4);
}

.card-face .cf-stat.power { left: 4px; background: radial-gradient(circle at 32% 28%, #d05a45, #7a2b1e); }
.card-face .cf-stat.health { right: 4px; background: radial-gradient(circle at 32% 28%, #46b97e, #1d5e3c); }

.card-face .cf-count {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 197, 9, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 197, 9, 0.55);
  color: var(--gold);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

/* The floating full card: everything the game records, shown on hover.
   Owner round 10 (2026-10-25): compact. `--ch-u` is the card's own scale — 1 in
   Main, the sheet's `--ov-u` on the overlay pair, where a fixed 224 px card is
   wider than the window itself. Every metric below is multiplied by it, so the
   overlay gets the same design, ~150 px wide instead of a clipped sliver. */

.card-hover {
  --ch-u: 1;
  position: fixed;
  z-index: 60;
  width: calc(224px * var(--ch-u));
  max-height: calc(100vh - 24px);
  pointer-events: none;
  filter: drop-shadow(0 14px 34px rgba(0, 0, 0, 0.55));
  visibility: hidden;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 90ms ease, visibility 90ms;
}

.overlay-body .card-hover {
  --ch-u: var(--ov-u);
}

.card-hover[hidden] {
  display: none;
}

.card-hover.show {
  visibility: visible;
  opacity: 1;
  transform: none;
}

.card-face.full {
  aspect-ratio: auto;
  padding: calc(8px * var(--ch-u)) calc(9px * var(--ch-u)) calc(7px * var(--ch-u));
  border-radius: calc(4px * var(--ch-u));
  border-width: calc(1px * var(--ch-u));
  background:
    radial-gradient(130% 60% at 50% 0%, color-mix(in srgb, var(--cf-border, #465b77) 22%, transparent), transparent 64%),
    var(--cf-bg, linear-gradient(168deg, #233247, #182433));
}

/* Full-bleed illustration behind the hover card's text (owner refinement 14):
   the scrim is deliberately heavy — rules text, type line and flavor all sit
   directly on the picture. */
.card-face.full.has-art {
  background-image:
    linear-gradient(180deg, rgba(6, 10, 18, 0.9), rgba(6, 10, 18, 0.78) 42%, rgba(6, 10, 18, 0.93)),
    var(--card-art);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.card-face.full .cf-head {
  display: flex;
  align-items: center;
  gap: calc(6px * var(--ch-u));
  margin-bottom: calc(1px * var(--ch-u));
}

.card-face.full .cf-mana {
  position: static;
  width: calc(18px * var(--ch-u));
  height: calc(18px * var(--ch-u));
  font-size: calc(10.5px * var(--ch-u));
}

.card-face.full .cf-head .cf-name {
  position: static;
  -webkit-line-clamp: unset;
  background: none;
  padding: 0;
  font-size: calc(12.5px * var(--ch-u));
  line-height: 1.2;
  text-align: left;
  flex: 1;
  min-width: 0;
}

.card-face.full .cf-type {
  position: static;
  text-align: left;
  font-size: calc(9.5px * var(--ch-u));
  line-height: 1.3;
  margin: 0 0 calc(6px * var(--ch-u)) calc(24px * var(--ch-u));
  white-space: normal;
}

.card-face.full .cf-statsline {
  display: flex;
  gap: calc(4px * var(--ch-u));
  margin: 0 0 calc(6px * var(--ch-u)) 0;
}

.card-face.full .cf-stat {
  position: static;
  width: calc(18px * var(--ch-u));
  height: calc(18px * var(--ch-u));
  font-size: calc(10.5px * var(--ch-u));
}

.card-face.full .cf-text {
  font-size: calc(11px * var(--ch-u));
  line-height: 1.4;
  color: #dfe7f2;
}

.card-face.full .cf-lpower {
  margin-top: calc(5px * var(--ch-u));
  padding: calc(3px * var(--ch-u)) calc(7px * var(--ch-u));
  border-left: calc(2px * var(--ch-u)) solid rgba(255, 197, 9, 0.65);
  border-radius: 0 calc(3px * var(--ch-u)) calc(3px * var(--ch-u)) 0;
  background: rgba(255, 197, 9, 0.08);
  color: #f0d391;
}

.card-face.full .cf-flavor {
  margin-top: calc(6px * var(--ch-u));
  font-style: italic;
  font-size: calc(10px * var(--ch-u));
  line-height: 1.35;
  color: var(--muted);
  border-top: calc(1px * var(--ch-u)) solid rgba(30, 43, 61, 0.7);
  padding-top: calc(5px * var(--ch-u));
}

/* Inline glyph tokens in rich descriptions. */

.rt-sprite {
  font-size: 0.92em;
}

.rt-sprite.power {
  color: #ff8a5f;
}

.rt-sprite.health {
  color: #7fe0a7;
}

