/* templates/grimdark.css — Grimdark Iron skin (rules whose every selector targets .dcc-tpl-grimdark). Ported 2026-10-31 from yaab css/cards-mode.css. */

.dcc-card.dcc-tpl-grimdark::before {
  content: '';
  position: absolute;
  inset: 0.72mm;
  /* frame width */
  z-index: 0;
  clip-path: polygon( 2.0mm 0, calc(100% - 2.0mm) 0, 100% 2.0mm, 100% calc(100% - 2.0mm), calc(100% - 2.0mm) 100%, 2.0mm 100%, 0 calc(100% - 2.0mm), 0 2.0mm);
  background: radial-gradient(ellipse at 50% -12%, rgba(150,116,52,0.14) 0%, rgba(0,0,0,0) 55%), radial-gradient(ellipse at 50% 120%, rgba(0,0,0,0.60) 0%, rgba(0,0,0,0) 60%), url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch' seed='7'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23g)'/></svg>"), linear-gradient(180deg, #1b1813 0%, #141109 55%, #0b0905 100%), #120f08;
  background-blend-mode: normal, normal, multiply, normal, normal;
  box-shadow: inset 0 0 0 0.18mm rgba(0,0,0,0.7), inset 0 0 6mm rgba(0,0,0,0.5);
}

/* Lift all flow content above the iron ::before layer. */
.dcc-card.dcc-tpl-grimdark > * { position: relative; z-index: 1; }

/* Corner rivets — small domed bronze studs in each bevelled corner. */
.dcc-card.dcc-tpl-grimdark::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(circle at 1.4mm 1.4mm, #f0d589 0 0.18mm, #6a4f1f 0.2mm 0.42mm, rgba(0,0,0,0.55) 0.46mm 0.6mm, transparent 0.62mm), radial-gradient(circle at calc(100% - 1.4mm) 1.4mm, #f0d589 0 0.18mm, #6a4f1f 0.2mm 0.42mm, rgba(0,0,0,0.55) 0.46mm 0.6mm, transparent 0.62mm), radial-gradient(circle at 1.4mm calc(100% - 1.4mm), #f0d589 0 0.18mm, #6a4f1f 0.2mm 0.42mm, rgba(0,0,0,0.55) 0.46mm 0.6mm, transparent 0.62mm), radial-gradient(circle at calc(100% - 1.4mm) calc(100% - 1.4mm), #f0d589 0 0.18mm, #6a4f1f 0.2mm 0.42mm, rgba(0,0,0,0.55) 0.46mm 0.6mm, transparent 0.62mm);
  background-repeat: no-repeat;
}

/* Continuation / duplex-back / empty cells opt OUT of the plate sandwich:
 * the iron ::before + bevel + rivets would fight their special content
 * (a back image, a partial parchment overlay, or nothing). */
.dcc-card.dcc-tpl-grimdark.dcc-card-cont, .dcc-card.dcc-tpl-grimdark.dcc-card-back, .dcc-card.dcc-tpl-grimdark.dcc-card-empty { clip-path: none; }
.dcc-card.dcc-tpl-grimdark.dcc-card-cont::before,
.dcc-card.dcc-tpl-grimdark.dcc-card-cont::after,
.dcc-card.dcc-tpl-grimdark.dcc-card-back::before,
.dcc-card.dcc-tpl-grimdark.dcc-card-back::after,
.dcc-card.dcc-tpl-grimdark.dcc-card-empty::before,
.dcc-card.dcc-tpl-grimdark.dcc-card-empty::after {
  display: none;
}
.dcc-card.dcc-tpl-grimdark.dcc-card-empty { background: transparent; }
.dcc-card.dcc-tpl-grimdark.dcc-card-back { background: #15120c; }

/* Continuation overlay keeps the iron surface (0,3,0 beats the runtime
 * texture injection). Its own bevelled top echoes the plate. */
.dcc-card.dcc-tpl-grimdark .dcc-cont-overlay { background: linear-gradient(180deg, #1a1712, #0c0a06), #131009; box-shadow: 0 2mm 3mm rgba(0,0,0,0.4); }
.dcc-card.dcc-tpl-grimdark.dcc-card-cont:not(.dcc-card-cont-art) .dcc-cont-overlay { border-bottom-color: #050402; }

/* Base flourish/stripe pseudo-elements are clipped away — repurpose ::before
 * as the banner boss and drop ::after. */
.dcc-tpl-grimdark .dcc-head::after { display: none; }
.dcc-tpl-grimdark .dcc-head::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0.18mm;
  margin-left: -1.6mm;
  width: 3.2mm;
  height: 1.5mm;
  background: linear-gradient(135deg, var(--gd-gold-bright) 0%, var(--gd-gold) 45%, var(--gd-gold-deep) 100%);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  z-index: 2;
}

/* Wide tracking + a cut shadow reads as stamped, engraved lettering. */
.dcc-tpl-grimdark .dcc-name { letter-spacing: 0.1em; text-shadow: 0 0.12mm 0.2mm rgba(0,0,0,0.75); }

/* Points pill → bronze; CP + invuln pips → dried blood. */
.dcc-tpl-grimdark .dcc-pts { background: linear-gradient(180deg, #3a2a10, #241a09); color: #f1e3bf; box-shadow: inset 0 0 0 0.1mm var(--gd-gold); }
.dcc-tpl-grimdark .dcc-head-strat .dcc-cp { background: linear-gradient(180deg, #8a1717, #560505); box-shadow: inset 0 0 0 0.12mm rgba(231,200,122,0.5); }

/* Header — a bevelled banner with a double gilt edge and a centred boss. */
.dcc-tpl-grimdark .dcc-head {
  margin: 0.2mm 0 1.0mm;
  border-radius: 0;
  padding: 1.3mm 2.2mm 1.5mm;
  background: linear-gradient(180deg, #262219 0%, #16130c 52%, #0a0805 100%);
  color: #efe3c4;
  /* Octagonal banner — both top + bottom corners cut. */
  clip-path: polygon( 1.4mm 0, calc(100% - 1.4mm) 0, 100% 1.0mm, 100% calc(100% - 1.0mm), calc(100% - 1.6mm) 100%, 1.6mm 100%, 0 calc(100% - 1.0mm), 0 1.0mm);
  box-shadow: inset 0 0.32mm 0 var(--gd-gold), inset 0 -0.46mm 0 var(--gd-gold);
}

/* Stat pillars — chamfered armour plates with a bronze top bevel (the gold
 * shows through the ::before sandwich) and bone numerals. */
.dcc-tpl-grimdark .dcc-stat-cell {
  background: linear-gradient(180deg, #d8b25a 0%, #a07e34 45%, #6f5021 100%);
  color: #f1e7c9;
  border-radius: 0;
  box-shadow: none;
  clip-path: polygon(0 1.1mm, 1.1mm 0, calc(100% - 1.1mm) 0, 100% 1.1mm, 100% 100%, 0 100%);
}
.dcc-tpl-grimdark .dcc-stat-cell::before {
  content: '';
  position: absolute;
  inset: 0.24mm;
  z-index: 0;
  clip-path: polygon(0 1.0mm, 1.0mm 0, calc(100% - 1.0mm) 0, 100% 1.0mm, 100% 100%, 0 100%);
  background: linear-gradient(180deg, #2a2620 0%, #15120c 100%);
}
.dcc-tpl-grimdark .dcc-stat-cell > * { position: relative; z-index: 1; }
.dcc-tpl-grimdark .dcc-stat-key { color: var(--gd-gold-bright); }
.dcc-tpl-grimdark .dcc-stat-rowlabel { color: var(--gd-gold); }

/* Section bars — arrow-tailed blackened-bronze banners with a left rivet. */
.dcc-tpl-grimdark .dcc-section-head {
  background: linear-gradient(180deg, #2b2417 0%, #1a160d 55%, #100d07 100%);
  color: #e8dcb8;
  border-radius: 0;
  padding-left: 3.0mm;
  position: relative;
  clip-path: polygon(1.6mm 0, 100% 0, 100% 100%, 1.6mm 100%, 0 50%);
  box-shadow: inset 0 0.18mm 0 var(--gd-gold), inset 0 -0.22mm 0 var(--gd-gold-deep);
}
.dcc-tpl-grimdark .dcc-section-head::before {
  content: '';
  position: absolute;
  left: 1.8mm;
  top: 50%;
  transform: translateY(-50%);
  width: 0.9mm;
  height: 0.9mm;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f0d589, #6a4f1f 70%, #2a1f0e);
  z-index: 1;
}
.dcc-tpl-grimdark .dcc-w-kw { color: var(--gd-ink-muted); }
.dcc-tpl-grimdark .dcc-w-table tr { border-bottom-color: rgba(227,218,201,0.14); }

/* templates/grimdark.css — Grimdark Iron skin. Ported from yaab css/cards-mode.css 961-1010 (+ interleaved base rules in card.css). */
/* Grimdark Iron
 * A full gothic-industrial REBUILD — not just a recolour. The skin
 * restructures the card's SHAPES, not only its palette:
 *   - the card is a cut-corner (octagonal-bevel) ARMOUR PLATE with a drawn
 *     oxidised-bronze frame and corner rivets;
 *   - the header is a bevelled BANNER with a double gilt edge + a gilt boss;
 *   - stat cells are chamfered STAT PILLARS with a bronze top bevel;
 *   - section bars are arrow-tailed riveted BANNERS;
 *   - the footer carries an ornamental gilt STAR boss on its divider.
 * Palette is the research "Imperial Gothic": blackened iron (near-black, NOT
 * #000 — avoids halation + worst home-printer ink pooling), warm BONE ink
 * (#e3dac9, never pure white), oxidised bronze/gold gilt, dried-blood pips.
 * Every shape is CSS clip-path + gradients + inline-SVG (no external art) so
 * it survives print; the print sheet already forces print-color-adjust:exact
 * on .dcc-card / .dcc-head / .dcc-section-head / .dcc-stat-cell /
 * .dcc-cont-overlay.
 * Shape architecture (the load-bearing trick): the card element IS the gold
 * plate — its background is the bronze metal, chamfered by clip-path. An
 * inset ::before paints the IRON interior (also chamfered), so the gold only
 * shows as a frame ring. Flow children are lifted to z-index:1 to sit above
 * that iron ::before; ::after stamps the corner rivets. Continuation / back /
 * empty cells opt OUT of the sandwich at the end of this block. */
.dcc-card.dcc-tpl-grimdark {
  --gd-ink: #e3dac9;
  /* bone — primary body ink */
  --gd-ink-strong: #f6efda;
  /* brighter bone for <strong> */
  --gd-ink-muted: #a2977f;
  /* ash — fine print, sub-bullets */
  --gd-gold: #c39a45;
  /* oxidised gold accent */
  --gd-gold-bright: #e7c87a;
  --gd-gold-deep: #7c5a22;
  --gd-rule: rgba(195, 154, 69, 0.42);
  --gd-bezel: 2.6mm;
  /* card corner cut */
  color: var(--gd-ink);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: calc(1.5mm + var(--dcc-safe, 0mm)) calc(1.7mm + var(--dcc-safe, 0mm));
  overflow: hidden;
  /* The card background IS the bronze frame (a faceted gold/brown metal
   * sweep). The iron interior is painted by ::before, inset by the frame
   * width, so the gold reads as a gilt ring around the plate. */
  background: linear-gradient(135deg, #b98f3c 0%, #e7c87a 17%, #8a6a2a 37%, #caa24a 52%, #6f5021 71%, #e7c87a 88%, #a87f33 100%);
  /* Octagonal bevel — the signature "tech-plate" cut corner. */
  clip-path: polygon( var(--gd-bezel) 0, calc(100% - var(--gd-bezel)) 0, 100% var(--gd-bezel), 100% calc(100% - var(--gd-bezel)), calc(100% - var(--gd-bezel)) 100%, var(--gd-bezel) 100%, 0 calc(100% - var(--gd-bezel)), 0 var(--gd-bezel));
}

/* Body ink: flip every dark-on-parchment colour to bone-on-iron. */
.dcc-tpl-grimdark .dcc-abilities-body, .dcc-tpl-grimdark .dcc-wargear-body, .dcc-tpl-grimdark .dcc-rule-text { color: var(--gd-ink); }
.dcc-tpl-grimdark .dcc-abilities-primarch .dcc-abilities-body { border-top-color: var(--gd-rule); }
.dcc-tpl-grimdark .dcc-ability-row strong, .dcc-tpl-grimdark .dcc-wargear-line strong { color: var(--gd-ink-strong); }
.dcc-tpl-grimdark .dcc-core-row { color: var(--gd-ink-muted); }
.dcc-tpl-grimdark .dcc-wargear-sub li::before { color: var(--gd-gold); }

/* Footer keywords. */
.dcc-tpl-grimdark .dcc-foot { border-top-color: var(--gd-rule); }
.dcc-tpl-grimdark .dcc-foot::before { background: linear-gradient(90deg, rgba(195,154,69,0) 0%, var(--gd-gold) 30%, var(--gd-gold) 70%, rgba(195,154,69,0) 100%); }

/* Ornamental gilt star boss centred on the footer divider — reads as a
 * stamped Imperial seal / purity stud. */
.dcc-tpl-grimdark .dcc-foot::after {
  content: '';
  position: absolute;
  top: -1.0mm;
  left: 50%;
  transform: translateX(-50%);
  width: 3.4mm;
  height: 1.7mm;
  z-index: 2;
  background: radial-gradient(circle at 50% 50%, #1a140a 0 0.28mm, transparent 0.32mm), linear-gradient(135deg, var(--gd-gold-bright), var(--gd-gold) 50%, var(--gd-gold-deep));
  clip-path: polygon(50% 0, 82% 30%, 100% 50%, 82% 70%, 50% 100%, 18% 70%, 0 50%, 18% 30%);
}
.dcc-tpl-grimdark .dcc-keywords { color: var(--gd-ink-muted); }
.dcc-tpl-grimdark .dcc-keywords strong { color: var(--gd-ink); }