/* Card, borough and development-board visual styling — the Victorian
   period option (approved mockup: .superpowers/brainstorm/1709860-1783891221
   /content/card-style.html, option B). Parchment ground, dark border + inner
   gold ring, Georgia small-caps titles, color band per card color, engraved
   -line art placeholder, medallion roundels. Class names here match exactly
   what app.js's cardNode/bottomRow/faceDownNode/boroughNode/boroughEdge
   builders emit. */

:root {
  --parchment: #f3ead3;
  --ink: #3a2d1c;
  --border-dark: #4a3320;
  --gold: #a08040;
  --gold-dim: #8a6d3b;
  --c-brown: #8a5a28;
  --c-blue: #6088b0;
  --c-pink: #b06080;
  --c-grey: #777777;
  --back-teal: #1f4e5f;
}

/* ---------- Card base + sizes ---------- */

.card {
  position: relative;
  background: var(--parchment);
  background-image: radial-gradient(ellipse at 50% 20%, rgba(255, 255, 255, 0.55), transparent 60%);
  border: 2px solid var(--border-dark);
  border-radius: 9px;
  box-shadow:
    inset 0 0 0 3px var(--parchment),
    inset 0 0 0 4px var(--gold),
    0 1px 3px rgba(0, 0, 0, 0.35);
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  flex-shrink: 0;
  user-select: none;
}

.card-full {
  width: 200px;
  height: 292px;
}

.card-med {
  width: 120px;
  height: 175px;
  border-radius: 7px;
  box-shadow:
    inset 0 0 0 2px var(--parchment),
    inset 0 0 0 3px var(--gold),
    0 1px 3px rgba(0, 0, 0, 0.3);
}

.card-mini {
  width: 34px;
  height: 50px;
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 1px var(--parchment),
    inset 0 0 0 2px var(--gold),
    0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ---------- Title (small-caps + rule flourish + color band) ---------- */

.title {
  margin: 9px 14px 6px;
  padding-bottom: 6px;
  text-align: center;
  font-variant: small-caps;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.06em;
  border-bottom: 3px solid var(--gold-dim);
}

.title::before,
.title::after {
  content: "──";
  color: var(--gold-dim);
  font-size: 0.7em;
  font-variant: normal;
  letter-spacing: normal;
  padding: 0 4px;
}

.card-med .title {
  margin: 6px 10px 4px;
  padding-bottom: 4px;
  font-size: 10.5px;
  border-bottom-width: 2px;
}

/* Full-size cards (zoom preview, scry modal) get the period display face;
   med/mini stay Georgia small-caps for legibility at their sizes. The
   Georgia-era "──" flourishes come off — they wrap badly around two-line
   Fell titles. */
.card-full .title {
  font-family: "IM Fell English SC", Georgia, serif;
  font-variant: normal;
  font-weight: 400;
  font-size: 16px;
}

.card-full .title::before,
.card-full .title::after {
  display: none;
}

.card-med .title::before,
.card-med .title::after {
  display: none;
}

.c-0.card-full .title,
.c-0.card-med .title { color: #5c3d1e; border-bottom-color: var(--c-brown); }
.c-1.card-full .title,
.c-1.card-med .title { color: #2d4a63; border-bottom-color: var(--c-blue); }
.c-2.card-full .title,
.c-2.card-med .title { color: #8f4060; border-bottom-color: var(--c-pink); }
.c-3.card-full .title,
.c-3.card-med .title { color: #444444; border-bottom-color: var(--c-grey); }

/* Mini card: title text only (no room for the full head treatment). A thin
   color stripe up top stands in for the color band. */

.card-mini { position: relative; overflow: hidden; }

.card-mini::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  height: 3px;
  border-radius: 2px;
}

.card-mini.c-0::before { background: var(--c-brown); }
.card-mini.c-1::before { background: var(--c-blue); }
.card-mini.c-2::before { background: var(--c-pink); }
.card-mini.c-3::before { background: var(--c-grey); }

.mini-title {
  position: absolute;
  inset: 7px 2px 2px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-variant: small-caps;
  font-weight: 700;
  font-size: 6.5px;
  line-height: 1.15;
  color: var(--ink);
}

/* ---------- Cost badge (top-left coin) ---------- */

.cost-badge {
  position: absolute;
  top: -9px;
  left: -9px;
  width: 24px;
  height: 24px;
  z-index: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, #f3d98b, #c9a13b);
  border: 1px solid #8f6f1f;
  box-shadow: 0 0 0 2px var(--parchment), 0 0 0 3px var(--gold);
  font-size: 10px;
  font-weight: 700;
  color: #4a3608;
}

.card-med .cost-badge {
  top: -7px;
  left: -7px;
  width: 18px;
  height: 18px;
  font-size: 8px;
}

/* ---------- Ongoing text / art placeholder / activated text ---------- */

.ongoing {
  margin: 4px 12px 0;
  padding: 3px 4px;
  font-size: 10.5px;
  font-style: italic;
  text-align: center;
  line-height: 1.25;
  border-top: 1px solid var(--gold-dim);
  border-bottom: 1px solid var(--gold-dim);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.card-med .ongoing {
  margin: 3px 8px 0;
  padding: 2px 3px;
  font-size: 8px;
  -webkit-line-clamp: 2;
}

.art {
  margin: 4px 12px;
  height: 64px;
  border-radius: 4px;
  border: 1px solid var(--gold);
  background: repeating-linear-gradient(0deg, #e7dcbe 0 3px, #dfd2b0 3px 4px);
}

.card-med .art {
  margin: 3px 8px;
  height: 34px;
}

.fx {
  padding: 6px 12px 0;
  font-size: 11.5px;
  text-align: center;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.card-med .fx {
  padding: 4px 8px 0;
  font-size: 8.5px;
  -webkit-line-clamp: 2;
}

/* ---------- Bottom row: activation cost roundel · symbols · flip ---------- */

.botrow {
  position: absolute;
  bottom: 8px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-med .botrow {
  bottom: 5px;
  left: 6px;
  right: 6px;
}

.roundel {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px double var(--gold-dim);
  background: #efe4c8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}

.roundel-spacer {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.card-med .roundel,
.card-med .roundel-spacer {
  width: 18px;
  height: 18px;
  font-size: 8px;
}

.symbols {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
}

.card-med .symbols {
  gap: 2px;
}

/* ---------- Symbol glyphs ---------- */

.sym-coin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f3d98b, #c9a13b);
  border: 1px solid #8f6f1f;
  color: #4a3608;
  font-weight: 700;
}

.symbols .sym-coin {
  width: 22px;
  height: 22px;
  font-size: 9.5px;
}

.card-med .symbols .sym-coin {
  width: 16px;
  height: 16px;
  font-size: 7.5px;
}

/* Roundel + sym-coin combined (activation cost paid in money): a coin
   medallion filling the roundel frame, per the approved mockup's .fb .coin
   ring trick rather than a literal double border. */
.roundel.sym-coin {
  border: 1px solid #8f6f1f;
  box-shadow: 0 0 0 2px var(--parchment), 0 0 0 3px var(--gold);
}

.sym-cardcost::before {
  content: "";
  display: block;
  width: 12px;
  height: 17px;
  border-radius: 2px;
  background: #2b2b2b;
  border: 2px solid #555555;
}

.card-med .sym-cardcost::before {
  width: 8px;
  height: 11px;
  border-width: 1px;
}

.sym-flip {
  font-size: 15px;
  color: #444444;
}

.card-med .sym-flip {
  font-size: 11px;
}

/* Diamond prestige badges. The element's own text must stay upright (the
   JS appends plain text, not a counter-rotated inner span), so the rotated
   diamond is painted as a ::before sitting behind it (z-index: -1) rather
   than rotating the whole badge as the mockup's CSS literally does. */
.sym-vp-now,
.sym-vp-end {
  position: relative;
  z-index: 0; /* stacking context, so the ::before diamond's z-index:-1 stays behind the digit but in FRONT of the card/borough background */
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
}

.sym-vp-now::before,
.sym-vp-end::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  transform: rotate(45deg);
}

.sym-vp-now::before { background: #8a7a55; border: 2px solid #5c522f; }
.sym-vp-now { color: #ffffff; }
.sym-vp-end::before { background: #faf6ea; border: 2px solid #8a7a55; }
.sym-vp-end { color: #4a3f24; }

.card-med .sym-vp-now,
.card-med .sym-vp-end {
  width: 16px;
  height: 16px;
  font-size: 8px;
}

.card-med .sym-vp-now::before,
.card-med .sym-vp-end::before {
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
}

.sym-pov-minus,
.sym-pov-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.sym-pov-minus { background: #2b2b2b; color: #ffffff; }
.sym-pov-plus { background: #7a2020; color: #f3ead3; }

.card-med .sym-pov-minus,
.card-med .sym-pov-plus {
  width: 14px;
  height: 14px;
  font-size: 9px;
}

.coins-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 10px;
  background: radial-gradient(circle at 35% 30%, #f3d98b, #c9a13b);
  border: 1px solid #8f6f1f;
  font-size: 9.5px;
  font-weight: 700;
  color: #4a3608;
}

.card-med .coins-badge {
  min-width: 15px;
  height: 15px;
  font-size: 7.5px;
}

/* ---------- Depth badge (buried-card count on a facedown top) ---------- */

.depth-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #e8e0cc;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.card-med .depth-badge {
  bottom: 4px;
  right: 4px;
  padding: 1px 5px;
  font-size: 9px;
}

.card-mini .depth-badge {
  bottom: 2px;
  right: 2px;
  padding: 0 3px;
  border-radius: 5px;
  font-size: 7px;
}

/* ---------- Card back (facedown) ---------- */

.card.facedown {
  background: var(--back-teal);
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 3px, transparent 3px 6px);
  border-color: #0d2830;
  box-shadow:
    inset 0 0 0 3px #2a5f70,
    inset 0 0 0 4px #16414e,
    0 1px 3px rgba(0, 0, 0, 0.4);
}

.card-med.facedown, .card-mini.facedown {
  box-shadow:
    inset 0 0 0 2px #2a5f70,
    inset 0 0 0 3px #16414e,
    0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ---------- Selection state + zoom overlay (T21 toggles these classes) ---------- */

.card.selectable {
  cursor: pointer;
  box-shadow:
    0 0 0 2px #d4b96a,
    inset 0 0 0 3px var(--parchment),
    inset 0 0 0 4px var(--gold),
    0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s ease-out;
}

.card.selectable:hover {
  transform: translateY(-6px);
}

.card.selected {
  box-shadow:
    0 0 0 3px #ffdf80,
    0 0 14px 3px rgba(255, 223, 128, 0.55),
    inset 0 0 0 3px var(--parchment),
    inset 0 0 0 4px var(--gold);
  transform: translateY(-8px);
}

/* #zoom (fixed, docked left, pointer-events: none) is style.css's job;
   .zoom here is the reading-copy treatment on the cloned full-size card
   inside it. The static transform and the keyframes' end state must agree
   (an animation that ends at scale(1) would snap the card smaller the
   moment it finished). */
.card.zoom {
  transform: scale(1.18);
  transform-origin: left center;
  box-shadow:
    inset 0 0 0 3px var(--parchment),
    inset 0 0 0 4px var(--gold),
    0 12px 40px rgba(0, 0, 0, 0.55);
  animation: zoom-pop 0.12s ease-out;
}

@keyframes zoom-pop {
  from { transform: scale(1.08); opacity: 0; }
  to { transform: scale(1.18); opacity: 1; }
}

/* ---------- Stack (overlapping display pile) ---------- */

.stack {
  display: inline-flex;
  align-items: flex-start;
}

.stack-peek {
  flex-shrink: 0;
}

.stack-peek + .card-full { margin-left: -20px; }
.stack-peek + .card-med { margin-left: -14px; }
.stack-peek + .card-mini { margin-left: -8px; }

/* ---------- Boroughs (landscape land tiles) ---------- */

.borough {
  width: 180px;
  height: 110px;
  flex-shrink: 0;
  position: relative;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  background: #e9e4c8;
  background-image: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.4), transparent 60%);
  border: 2px solid var(--border-dark);
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 2px #e9e4c8,
    inset 0 0 0 3px var(--gold),
    0 1px 3px rgba(0, 0, 0, 0.3);
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  user-select: none;
}

.b-head {
  display: flex;
  align-items: center;
  gap: 5px;
}

.b-loc {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gold-dim);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
}

.b-loc.river {
  background: #3d6a86;
}

.b-name {
  flex: 1;
  font-variant: small-caps;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.b-cost {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #4a3608;
}

.b-benefits {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.b-draw {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
}

/* Tiny card-back chip standing in for the U+1F0A0 playing-card glyph,
   which is tofu on plenty of systems. */
.draw-glyph {
  display: inline-block;
  width: 9px;
  height: 13px;
  border-radius: 2px;
  background: var(--back-teal);
  border: 1px solid #0d2830;
  box-shadow: inset 0 0 0 1px #2a5f70;
}

.b-active {
  font-size: 9.5px;
  font-style: italic;
  color: var(--border-dark);
  border-top: 1px solid var(--gold-dim);
  padding-top: 2px;
}

.b-optional {
  font-size: 9px;
  color: #5c4a2e;
  line-height: 1.2;
  overflow: hidden;
}

/* T21: buy_land — clickable market boroughs. Compound selector (not a bare
   .selectable) so it wins over .borough's own box-shadow regardless of
   stylesheet load order. */
.borough.selectable {
  cursor: pointer;
  box-shadow:
    inset 0 0 0 2px #e9e4c8,
    inset 0 0 0 3px var(--gold),
    0 0 0 2px #d4b96a,
    0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s ease-out;
}

.borough.selectable:hover {
  transform: translateY(-4px);
}

/* Covered borough: a slim left-edge strip (name reads top-to-bottom). */

.borough-edge {
  width: 22px;
  height: 110px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 2px;
  overflow: hidden;
  background: #d8d0ac;
  border: 2px solid var(--border-dark);
  border-right: none;
  border-radius: 6px 0 0 6px;
  color: var(--ink);
  user-select: none;
}

.borough-edge.river {
  background: #c7d4c9;
}

.borough-edge > span + span {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-variant: small-caps;
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.02em;
}

/* boroughPile (app.js): every borough but the last as an edge, the last
   (top, per Player.Boroughs' "last = top" ordering) as a full tile,
   overlapping like a fan of index tabs. */

.borough-pile {
  display: flex;
  align-items: stretch;
}

.borough-pile > .borough-edge + .borough-edge,
.borough-pile > .borough-edge + .borough {
  margin-left: -12px;
}

/* Compact: the opponent strip's borough pile, sized down for real (not a
   CSS transform, so the layout doesn't reserve full-size space). */

.borough-pile.compact .borough {
  width: 92px;
  height: 56px;
  padding: 4px 6px;
  gap: 2px;
}

.borough-pile.compact .borough .b-name { font-size: 9px; }
.borough-pile.compact .borough .b-cost { font-size: 8px; }
.borough-pile.compact .borough .b-benefits { font-size: 8px; gap: 3px; }
.borough-pile.compact .borough .b-loc { width: 13px; height: 13px; font-size: 7px; }
.borough-pile.compact .borough .b-active,
.borough-pile.compact .borough .b-optional { display: none; }

.borough-pile.compact .borough-edge {
  width: 12px;
  height: 56px;
}

.borough-pile.compact .borough-edge > span + span {
  font-size: 7px;
}

.borough-pile.compact > .borough-edge + .borough-edge,
.borough-pile.compact > .borough-edge + .borough {
  margin-left: -8px;
}
