/* BRASS skin - a warm 19th-century star-atlas plate: aged paper, engraved ink and brass fittings.
   Idea: tier is told by depth of ink and richness of ornament, never by colour, from a faint proof to a gilded plate. */

body.skin-brass {
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(214, 164, 86, .28), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 226, 160, .025) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, .05) 0 2px, transparent 2px 6px),
    #2b1e13;
  background-attachment: fixed;
  color: #ead9b0;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, "Times New Roman", Times, serif;
  min-height: 100vh;
}

/* ---------- plate shell (defaults = Common, tiers deepen the ink) ---------- */

body.skin-brass .card {
  --ink-rgb: 102, 80, 47;
  --ink: rgb(var(--ink-rgb));
  --ink-soft: rgba(var(--ink-rgb), .55);
  --paper: #ece3c9;
  --paper-hi: #f3ecd6;
  --paper-lo: #d8c9a0;
  --gilt: #a9811f;
  --brass: linear-gradient(135deg, #f3dc8f 0%, #c9a24a 30%, #8c6a22 55%, #d9b95f 80%, #8c6a22 100%);
  --ow: 1.7;
  --rt: 1px;
  --rg: 1px;
  --bw: 1px;
  --bstyle: solid;
  --bsh: none;
  --echo: none;

  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: 392px;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
  margin: 0;
  padding: 13px 12px 9px;
  overflow: hidden;
  border-radius: 3px;
  border: var(--bw) var(--bstyle) var(--ink);
  color: var(--ink);
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, "Times New Roman", Times, serif;
  background: radial-gradient(120% 90% at 50% 42%, var(--paper-hi) 0%, var(--paper) 58%, var(--paper-lo) 100%);
  box-shadow:
    inset 0 0 26px rgba(120, 76, 22, .38),
    0 1px 0 rgba(255, 236, 190, .35),
    0 6px 14px rgba(0, 0, 0, .45);
  transition: transform .2s ease;
}

body.skin-brass .card:hover {
  transform: translateY(-2px);
}

/* paper texture: laid lines, foxing spots and tide-line stains */
body.skin-brass .card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(circle at 12% 18%, rgba(120, 80, 30, .16) 0, rgba(120, 80, 30, .16) 2px, transparent 3px),
    radial-gradient(circle at 86% 12%, rgba(120, 80, 30, .12) 0, rgba(120, 80, 30, .12) 1.5px, transparent 3px),
    radial-gradient(circle at 70% 82%, rgba(120, 80, 30, .14) 0, rgba(120, 80, 30, .14) 2.5px, transparent 4px),
    radial-gradient(circle at 20% 90%, rgba(120, 80, 30, .10) 0, rgba(120, 80, 30, .10) 1.5px, transparent 3px),
    radial-gradient(ellipse at 100% 100%, rgba(120, 80, 30, .25), transparent 55%),
    radial-gradient(ellipse at 0% 0%, rgba(120, 80, 30, .18), transparent 50%),
    repeating-linear-gradient(0deg, rgba(70, 45, 15, .045) 0 1px, transparent 1px 3px);
}

/* inner printed frame + gilt corner brackets, switched on by the higher tiers */
body.skin-brass .card::after {
  content: "";
  display: none;
  position: absolute;
  z-index: 3;
  box-sizing: border-box;
  pointer-events: none;
  border-radius: 2px;
}

body.skin-brass .card > * {
  position: relative;
  z-index: 1;
  flex: none;
  margin: 0;
}

/* ---------- top rule: thick-thin printer's rule, sits under the header ---------- */

body.skin-brass .card .rule {
  order: 2;
  box-sizing: border-box;
  height: calc(var(--rt) + var(--rg) + 1px);
  border-top: var(--rt) solid var(--ink);
  border-bottom: 1px solid var(--ink);
  overflow: visible;
}

body.skin-brass .card .rule::after {
  content: "";
  display: none;
}

/* ---------- header ---------- */

body.skin-brass .card header {
  order: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 18px;
}

body.skin-brass .card .tier {
  display: inline-block;
  padding: 0 1px;
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
}

body.skin-brass .card .idx {
  font-size: 12px;
  font-style: italic;
  font-weight: 600;
  color: rgba(var(--ink-rgb), .85);
}

body.skin-brass .card .idx::before {
  content: "No. ";
  font-size: 10px;
}

/* ---------- orbit plot: a ruled engraving panel with a faint graticule ---------- */

body.skin-brass .card .plot {
  order: 3;
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background:
    linear-gradient(rgba(var(--ink-rgb), .07) 1px, transparent 1px) 0 0 / 100% 20px,
    linear-gradient(90deg, rgba(var(--ink-rgb), .07) 1px, transparent 1px) 0 0 / 20px 100%,
    radial-gradient(circle at 50% 50%, var(--paper-hi) 0%, var(--paper) 100%);
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px var(--ink-soft);
}

body.skin-brass .card .orb {
  position: absolute;
  inset: 6px;
  display: block;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  overflow: visible;
}

body.skin-brass .card .ring {
  fill: none;
  stroke: var(--ink);
  stroke-opacity: .30;
  stroke-width: .7;
}

body.skin-brass .card .shadow {
  fill: none;
  stroke: var(--ink);
  stroke-opacity: .6;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: .1 3.8;
}

body.skin-brass .card .ghost {
  fill: none;
  stroke: var(--ink);
  stroke-opacity: .28;
  stroke-width: 1;
}

body.skin-brass .card .orbit {
  fill: none;
  stroke: var(--ink);
  stroke-width: var(--ow);
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: var(--echo);
}

body.skin-brass .card .qline {
  stroke: var(--ink);
  stroke-opacity: .75;
  stroke-width: .9;
  stroke-dasharray: 2 2;
}

body.skin-brass .card .sun {
  fill: #c19a3a;
  stroke: var(--ink);
  stroke-width: 1.2;
}

body.skin-brass .card .body {
  fill: var(--ink);
  stroke: #c9a24a;
  stroke-width: 1.8;
}

/* ---------- name ---------- */

body.skin-brass .card h2 {
  order: 4;
  height: 22px;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 16px;
  font-weight: 700;
  font-variant: small-caps;
  line-height: 22px;
  letter-spacing: .04em;
  color: var(--ink);
}

/* ---------- the product: the observation count, engraved large ---------- */

body.skin-brass .card .count {
  order: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

body.skin-brass .card .count b {
  display: block;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, "Times New Roman", Times, serif;
  font-size: 54px;
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.01em;
  white-space: nowrap;
  color: var(--ink);
  text-shadow: var(--bsh);
}

body.skin-brass .card .count span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-style: italic;
  line-height: 13px;
  text-align: center;
  color: rgba(var(--ink-rgb), .82);
}

/* ---------- elements: table with dotted leaders ---------- */

body.skin-brass .card .els {
  order: 6;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 14px;
  padding: 4px 0 2px;
  border-top: 1px solid var(--ink-soft);
}

body.skin-brass .card .els > div {
  display: flex;
  align-items: baseline;
  min-height: 17px;
}

body.skin-brass .card .els dt {
  display: flex;
  flex: 1 1 auto;
  align-items: baseline;
  margin: 0;
  font-size: 12.5px;
  font-style: italic;
  font-weight: 700;
  line-height: 17px;
  color: var(--ink);
}

body.skin-brass .card .els dt::after {
  content: "";
  flex: 1 1 auto;
  margin: 0 4px;
  border-bottom: 1px dotted var(--ink-soft);
  transform: translateY(-3px);
}

body.skin-brass .card .els dd {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 17px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ---------- footer ---------- */

body.skin-brass .card footer {
  order: 7;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 9px;
  font-style: italic;
  line-height: 11px;
  color: rgba(var(--ink-rgb), .72);
}

/* =====================================================================
   TIERS - deeper ink and richer ornament as rarity rises. Rarest first.
   ===================================================================== */

/* MYTHIC - blackest ink, triple frame, gilt corners, brass-filled rule, gilded numerals */
body.skin-brass .card.t-mythic {
  --ink-rgb: 13, 7, 3;
  --paper: #ddc995;
  --paper-hi: #e9d6a3;
  --paper-lo: #b99b5e;
  --ow: 3.4;
  --rt: 4px;
  --rg: 3px;
  --bw: 6px;
  --bstyle: double;
  --bsh: 0 1px 0 #f3dc8f, 0 2px 0 #a9811f, 0 3px 3px rgba(60, 35, 10, .35);
  --echo: drop-shadow(1px 1px 0 rgba(184, 140, 48, .95));
  box-shadow:
    inset 0 0 30px rgba(120, 76, 22, .45),
    0 0 0 2px #b08d3c,
    0 0 0 3px #1a0f05,
    0 8px 18px rgba(0, 0, 0, .55);
}

body.skin-brass .card.t-mythic .rule {
  background: var(--brass);
}

body.skin-brass .card.t-mythic .rule::after {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  margin: -6px 0 0 -6px;
  transform: rotate(45deg);
  background: var(--brass);
  border: 1px solid var(--ink);
}

body.skin-brass .card.t-mythic .tier {
  padding: 2px 9px;
  background: var(--brass);
  border: 1px solid var(--ink);
  box-shadow: 0 0 0 2px var(--paper-hi), 0 0 0 3px var(--ink);
}

body.skin-brass .card.t-mythic .tier::before {
  content: "\2726\00a0";
}

body.skin-brass .card.t-mythic .tier::after {
  content: "\00a0\2726";
}

body.skin-brass .card.t-mythic::after,
body.skin-brass .card.t-legendary::after {
  display: block;
  inset: 5px;
  border: 1px solid rgba(var(--ink-rgb), .85);
  background:
    linear-gradient(var(--gilt), var(--gilt)) 0 0 / var(--br-len) 3px no-repeat,
    linear-gradient(var(--gilt), var(--gilt)) 0 0 / 3px var(--br-len) no-repeat,
    linear-gradient(var(--gilt), var(--gilt)) 100% 0 / var(--br-len) 3px no-repeat,
    linear-gradient(var(--gilt), var(--gilt)) 100% 0 / 3px var(--br-len) no-repeat,
    linear-gradient(var(--gilt), var(--gilt)) 0 100% / var(--br-len) 3px no-repeat,
    linear-gradient(var(--gilt), var(--gilt)) 0 100% / 3px var(--br-len) no-repeat,
    linear-gradient(var(--gilt), var(--gilt)) 100% 100% / var(--br-len) 3px no-repeat,
    linear-gradient(var(--gilt), var(--gilt)) 100% 100% / 3px var(--br-len) no-repeat;
}

body.skin-brass .card.t-mythic { --br-len: 18px; }
body.skin-brass .card.t-legendary { --br-len: 14px; }

/* LEGENDARY - near-black ink, double rule, gilt corners, ink-filled plate badge */
body.skin-brass .card.t-legendary {
  --ink-rgb: 25, 13, 5;
  --paper: #e0cf9f;
  --paper-hi: #ebdbb0;
  --paper-lo: #c2a870;
  --ow: 3;
  --rt: 3px;
  --rg: 2px;
  --bw: 5px;
  --bstyle: double;
  --bsh: 0 1px 0 #f0d98f, 0 2px 0 #b08d3c;
  --echo: drop-shadow(1px 1px 0 rgba(184, 140, 48, .85));
  box-shadow:
    inset 0 0 28px rgba(120, 76, 22, .42),
    0 0 0 1px #b08d3c,
    0 7px 16px rgba(0, 0, 0, .5);
}

body.skin-brass .card.t-legendary .rule::after {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  margin: -5px 0 0 -5px;
  transform: rotate(45deg);
  background: var(--paper-hi);
  border: 1px solid var(--ink);
}

body.skin-brass .card.t-legendary .tier {
  padding: 2px 9px;
  color: var(--paper-hi);
  background: var(--ink);
}

body.skin-brass .card.t-legendary .tier::before {
  content: "\25C6\00a0";
}

body.skin-brass .card.t-legendary .tier::after {
  content: "\00a0\25C6";
}

/* EPIC - dark ink, triple-line border, inner frame, small diamond on the rule */
body.skin-brass .card.t-epic {
  --ink-rgb: 39, 22, 8;
  --paper: #e3d4ab;
  --paper-hi: #ede0bd;
  --paper-lo: #c9b27f;
  --ow: 2.6;
  --rt: 3px;
  --rg: 1px;
  --bw: 3px;
  --bstyle: double;
  --bsh: 0 1px 0 rgba(255, 244, 210, .9), 0 2px 0 rgba(176, 141, 60, .7);
}

body.skin-brass .card.t-epic::after {
  display: block;
  inset: 4px;
  border: 1px solid var(--ink-soft);
}

body.skin-brass .card.t-epic .rule::after {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  margin: -4px 0 0 -4px;
  transform: rotate(45deg);
  background: var(--paper-hi);
  border: 1px solid var(--ink);
}

body.skin-brass .card.t-epic .tier {
  padding: 1px 8px;
  border: 1px solid var(--ink);
}

body.skin-brass .card.t-epic .tier::before {
  content: "\00b7\00a0";
}

body.skin-brass .card.t-epic .tier::after {
  content: "\00a0\00b7";
}

/* RARE - firm ink, heavier single border with a hairline inner frame, underlined badge */
body.skin-brass .card.t-rare {
  --ink-rgb: 53, 32, 12;
  --paper: #e6d9b6;
  --paper-hi: #efe4c6;
  --paper-lo: #cfbb8b;
  --ow: 2.3;
  --rt: 2px;
  --rg: 1px;
  --bw: 2px;
  --bsh: 0 1px 0 rgba(255, 244, 210, .9);
}

body.skin-brass .card.t-rare::after {
  display: block;
  inset: 3px;
  border: 1px solid rgba(var(--ink-rgb), .4);
}

body.skin-brass .card.t-rare .tier {
  border-bottom: 1px solid var(--ink);
}

/* UNCOMMON - medium ink, single border, plain badge */
body.skin-brass .card.t-uncommon {
  --ink-rgb: 74, 48, 21;
  --paper: #e9dec0;
  --paper-hi: #f1e8cf;
  --paper-lo: #d4c397;
  --ow: 2;
  --rt: 2px;
  --rg: 0px;
  --bw: 2px;
  --bsh: 0 1px 0 rgba(255, 244, 210, .7);
}

/* COMMON - faint sepia ink, hairline border, no ornament (the defaults) */
body.skin-brass .card.t-common {
  --ink-rgb: 102, 80, 47;
  --ow: 1.7;
}

/* CONTROL - a grey unprinted proof: dashed edge, thinnest ink, no gilt */
body.skin-brass .card.t-control {
  --ink-rgb: 111, 107, 96;
  --paper: #e4e0d4;
  --paper-hi: #eceae0;
  --paper-lo: #cfcbbb;
  --ow: 1.4;
  --bstyle: dashed;
  box-shadow:
    inset 0 0 20px rgba(90, 84, 70, .25),
    0 5px 12px rgba(0, 0, 0, .4);
}

body.skin-brass .card.t-control .rule {
  border-top-style: dashed;
  border-bottom-style: dashed;
}

body.skin-brass .card.t-control .tier {
  font-style: italic;
}

body.skin-brass .card.t-control .orbit {
  stroke-dasharray: 6 3;
}

@media (prefers-reduced-motion: reduce) {
  body.skin-brass .card {
    transition: none;
  }
}
