/* =====================================================================
   Opus Academica — Cuaderno Alquímico Iluminado
   Theme overlay, applied AFTER styles.css. Pure visual layer; do not
   change DOM structure or class names. To revert, remove the <link> tag.
   ===================================================================== */

:root {
  /* Paper & ink */
  --oa-paper:        #f4e8c8;          /* aged cream */
  --oa-paper-warm:   #ede0b8;
  --oa-paper-deep:   #e2d2a4;
  --oa-vellum:       #fbf2dc;          /* lighter panel surface */
  --oa-ink:          #1a140a;          /* iron-gall, near-black warm */
  --oa-ink-soft:     #4a3d28;
  --oa-ink-fade:     #7a6b4f;
  --oa-line:         #b89c6a;          /* warm sepia rule */
  --oa-line-soft:    #d4be8a;

  /* Rubric & accent inks */
  --oa-rubric:       #8b1f15;          /* vermillion / minium */
  --oa-rubric-deep:  #6c1810;
  --oa-rubric-soft:  rgba(139, 31, 21, 0.10);
  --oa-gold:         #b8923b;          /* aged gold leaf */
  --oa-gold-bright:  #e3b958;
  --oa-gold-soft:    rgba(184, 146, 59, 0.18);
  --oa-verdigris:    #5e7a6a;          /* muted patina green */
  --oa-azurite:      #2a4263;          /* deep blue ink */

  /* Override base tokens used throughout styles.css */
  --bg:        var(--oa-paper);
  --paper:     var(--oa-vellum);
  --ink:       var(--oa-ink);
  --muted:     var(--oa-ink-fade);
  --line:      var(--oa-line-soft);
  --accent:    var(--oa-azurite);
  --accent-soft: rgba(42, 66, 99, 0.10);
  --danger:    var(--oa-rubric);
}

/* ---------- Typography ---------------------------------------------- */
body {
  font-family: "EB Garamond", "Cardo", "Garamond", Georgia, serif;
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1, "lnum" 0;
  font-size: 17px;
  line-height: 1.45;
  background:
    radial-gradient(ellipse at 18% 12%, rgba(255,247,225,0.65) 0%, transparent 55%),
    radial-gradient(ellipse at 88% 88%, rgba(184,146,59,0.18) 0%, transparent 50%),
    radial-gradient(circle at 60% 50%, rgba(139,31,21,0.04) 0%, transparent 70%),
    var(--oa-paper);
  /* paper grain (SVG noise inline) */
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 0.32  0 0 0 0 0.24  0 0 0 0 0.10  0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  opacity: 0.55;
}

/* Enable tabular numerals for any code/mono usage */
code, .stat-num, .res, .score-chip strong, .obj-pp-chip,
#deckCount, .meeples code, .pi-section code {
  font-family: "IBM Plex Mono", "Menlo", monospace;
  font-feature-settings: "tnum" 1, "zero" 1;
}

/* ---------- Topbar -------------------------------------------------- */
.topbar {
  background:
    linear-gradient(180deg, rgba(255,250,234,0.85) 0%, rgba(241,225,180,0.85) 100%),
    var(--oa-paper);
  border-bottom: none;
  padding: 22px 28px 16px 28px;
  position: relative;
}
.topbar::after {
  content: "";
  position: absolute; left: 28px; right: 28px; bottom: 0; height: 3px;
  background:
    linear-gradient(90deg,
      transparent 0%,
      var(--oa-rubric) 6%,
      var(--oa-gold) 50%,
      var(--oa-rubric) 94%,
      transparent 100%);
  opacity: 0.85;
}

.topbar h1 {
  font-family: "EB Garamond", "Cardo", serif;
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: 0.01em;
  color: var(--oa-ink);
  font-variant: small-caps;
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
  position: relative;
  padding-left: 0.05em;
}
.topbar h1::first-letter {
  font-family: "EB Garamond", "Cardo", serif;
  font-weight: 700;
  font-size: 1.4em;
  color: var(--oa-rubric);
  margin-right: 0.04em;
}

/* ---------- Status badges → wax-seal style -------------------------- */
.status-badge {
  font-family: "EB Garamond", serif;
  font-variant: small-caps;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  padding: 6px 13px;
  border-radius: 4px;
  border: 1px solid var(--oa-line);
  background: var(--oa-vellum);
  color: var(--oa-ink-soft);
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 1px 2px rgba(0,0,0,0.06);
}
.status-badge-round {
  background: linear-gradient(180deg, #fbf2dc 0%, #ecdfba 100%);
  color: var(--oa-ink-soft);
}
.status-badge-turn {
  gap: 8px;
  min-width: max-content;
  white-space: nowrap;
  background: linear-gradient(180deg, #b8261b 0%, #6c1810 100%);
  color: #fbecd2;
  border-color: #4d100a;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.18) inset,
    0 0 0 2px rgba(139,31,21,0.18),
    0 2px 6px rgba(108,24,16,0.45);
  font-weight: 700;
  letter-spacing: 0.12em;
}
.status-badge-turn::before {
  content: "" !important;
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: var(--turn-color, var(--oa-rubric));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.3), 0 1px 2px rgba(0,0,0,0.25);
}
.status-badge-leader {
  background: linear-gradient(180deg, #f3d579 0%, #c79a3a 100%);
  color: #3d2c0a;
  border-color: #8c6a1f;
}

.phase-theme-badge {
  font-family: "EB Garamond", serif;
  font-variant: small-caps;
  gap: 7px;
  letter-spacing: 0.1em;
  font-weight: 600;
  font-size: 0.82rem;
  border-radius: 4px;
  border: 1px solid var(--oa-line);
  background: var(--oa-vellum);
  color: var(--oa-ink-soft);
}
.phase-theme-icon {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(58,40,16,0.25));
}
.phase-theme-night {
  background: linear-gradient(180deg, #1d2230 0%, #11151f 100%);
  border-color: #3a4358;
  color: #e3c97a;
  text-shadow: 0 0 8px rgba(227,201,122,0.45);
}

.restart-btn {
  font-family: "EB Garamond", serif;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--oa-rubric);
  color: var(--oa-rubric);
  background: var(--oa-vellum);
}
.restart-btn:hover { background: rgba(139,31,21,0.08); }

#debugToggle {
  font-family: "EB Garamond", serif;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--oa-line);
  color: var(--oa-ink-fade);
  background: var(--oa-vellum);
  padding: 6px 13px;
}

/* ---------- Panels (generic) --------------------------------------- */
.panel,
.subpanel,
.market-strip-item,
.tu-panel,
.rivals-section,
.player,
.rival-card,
.action-panel-inline,
.obj-market-card {
  background: var(--oa-vellum);
  border: 1px solid var(--oa-line);
  border-radius: 4px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.55) inset,
    0 2px 6px rgba(60,40,10,0.06);
}
.panel h2, .subpanel h2,
.tu-head h2, .rivals-head, .market-strip-item h3 {
  font-family: "EB Garamond", "Cardo", serif;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--oa-rubric);
  border-bottom: 1px solid var(--oa-rubric-soft);
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.tu-panel { padding: 16px; gap: 12px; position: relative; z-index: 1; display: flex; flex-direction: column; }
.tu-panel .tu-head { order: 1; }
.tu-panel #players { order: 2; }

/* Reorder inside the player card: name → meeples → mano → resources → score → academias → objetivos */
.tu-panel .player { display: flex; flex-direction: column; gap: 4px; }
.tu-panel .player .player-head            { order: 1; }
.tu-panel .player .sub:has(+ .meeples)    { order: 2; }
.tu-panel .player .meeples                { order: 3; }
.tu-panel .player .sub:has(+ .hand)       { order: 4; }
.tu-panel .player .hand                   { order: 5; }
.tu-panel .player .res-grid               { order: 6; }
.tu-panel .player .score-split            { order: 7; }
/* leftover .sub elements (e.g. "Academias / Terrenos") and obj-list go last */
.tu-panel .player .sub                    { order: 8; }
.tu-panel .player .sub:has(+ .obj-list)   { order: 9; }
.tu-panel .player .obj-list               { order: 10; }
.tu-head h2 {
  font-size: 1.4rem;
  color: var(--oa-ink);
  border-bottom-color: var(--oa-line);
}
.tu-head h2::first-letter {
  color: var(--oa-rubric);
  font-weight: 700;
  font-size: 1.4em;
  margin-right: 0.04em;
}
#statusLine {
  font-style: italic;
  color: var(--oa-ink-fade);
  font-size: 0.95rem;
  padding-bottom: 4px;
  border-bottom: 1px dotted var(--oa-line-soft);
}

/* ---------- Player card -------------------------------------------- */
.tu-panel .player {
  padding: 16px;
  border-radius: 4px;
  border: 1px solid var(--oa-line);
  background:
    linear-gradient(180deg, #fdf6dd 0%, #f3e7c2 100%);
}
.player-head { margin-bottom: 10px; align-items: baseline; gap: 10px; }
.player-name {
  font-family: "EB Garamond", "Cardo", serif;
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: 0.01em;
  font-variant: small-caps;
}

.badge {
  font-family: "EB Garamond", serif;
  font-variant: small-caps;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  border-radius: 3px;
  padding: 2px 7px;
}
.badge-human {
  background: var(--oa-rubric);
  color: #fbecd2;
  border-color: var(--oa-rubric-deep);
}
.badge-bot {
  background: var(--oa-vellum);
  color: var(--oa-ink-fade);
  border-color: var(--oa-line);
}

/* ---------- Resources: alchemical tokens --------------------------- */
.res-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 6px 0 10px 0;
}
.res {
  flex-direction: column;
  gap: 2px;
  padding: 10px 6px;
  border-radius: 4px;
  background:
    radial-gradient(circle at 50% 35%, #fbf2d8 0%, #ecdcb1 80%);
  border: 1px solid var(--oa-line);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--oa-ink);
  position: relative;
  font-feature-settings: "tnum" 1, "onum" 1;
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 1px 2px rgba(0,0,0,0.05);
}
.res::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(184,146,59,0.25);
  border-radius: 3px;
  pointer-events: none;
}
.res-icon-img { width: 22px; height: 22px; opacity: 0.92; }

/* sub label rows */
.sub {
  font-family: "EB Garamond", serif;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  color: var(--oa-rubric);
  font-size: 0.85rem;
  margin: 8px 0 4px 0;
  font-weight: 600;
}

/* ---------- Score chips → wax-seal --------------------------------- */
.score-split { gap: 8px; margin: 8px 0 10px 0; }
.score-chip {
  font-family: "EB Garamond", serif;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  padding: 5px 12px;
  border-radius: 3px;
  border: 1px solid var(--oa-line);
  background: var(--oa-vellum);
  color: var(--oa-ink-soft);
}
.score-chip strong {
  font-size: 1.05rem;
  color: var(--oa-ink);
  margin-left: 4px;
}
.score-chip-base { background: linear-gradient(180deg, #f9efd4 0%, #ecdcb1 100%); }
.score-chip-obj  {
  background: linear-gradient(180deg, #f5e8d2 0%, #e0c898 100%);
  border-color: var(--oa-gold);
  color: #5d4710;
}
.score-chip-total {
  background: linear-gradient(180deg, var(--oa-rubric) 0%, var(--oa-rubric-deep) 100%);
  color: #fbecd2;
  border-color: var(--oa-rubric-deep);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 2px 4px rgba(108,24,16,0.4);
  font-weight: 700;
}
.score-chip-total strong { color: #fff5d2; }

/* ---------- Hand --------------------------------------------------- */
.hand {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  list-style: none;
  padding: 0;
  margin: 4px 0 6px 0;
}
.hand-item {
  font-family: "EB Garamond", serif;
  font-size: 0.92rem;
  padding: 6px 9px;
  background: var(--oa-vellum);
  border: 1px solid var(--oa-line-soft);
  border-left: 4px solid var(--oa-ink-fade);
  border-radius: 3px;
  color: var(--oa-ink);
  cursor: default;
  transition: background 0.15s, border-color 0.15s;
}
.hand-item:hover { background: #faecc7; }

/* Color the hand stripe by card type */
.hand-item[data-type="academia"]            { border-left-color: #6a45a0; }
.hand-item[data-type="academia"]:hover      { border-left-color: #4a2680; background: #f3edfb; }
.hand-item[data-type="terreno"]             { border-left-color: #3a8a4e; }
.hand-item[data-type="terreno"]:hover       { border-left-color: #1e5a30; background: #ecf6ee; }
.hand-item[data-type=""],
.hand-item[data-type="neutral"]             { border-left-color: var(--oa-ink-fade); }

/* ---------- Meeples row ------------------------------------------- */
.meeples {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  font-size: 0.82rem;
}
.meeples > .meeple-cell,
.meeples > div {
  background: var(--oa-vellum);
  border: 1px solid var(--oa-line-soft);
  border-radius: 3px;
  padding: 6px 8px;
  text-align: center;
  position: relative;
  transition: transform 0.1s, border-color 0.12s;
}
.meeples .meeple-cell strong {
  display: block;
  font-family: "EB Garamond", serif;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  color: var(--oa-ink);
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 1px;
}
.meeples code {
  font-size: 0.78rem;
  color: var(--oa-ink-fade);
  background: transparent;
  padding: 0;
}

/* Pickable meeple — blue glow signaling "click me to choose" */
.meeple-cell.meeple-pickable {
  cursor: pointer;
  background: linear-gradient(180deg, #e9f1fb 0%, #cbddf2 100%);
  border: 1.5px solid #3f73bd;
  color: #1f3658;
  animation: oa-meeple-glow 1.3s ease-in-out infinite;
}
.meeple-cell.meeple-pickable strong { color: #1f3658; }
.meeple-cell.meeple-pickable code   { color: #2a4263; }
.meeple-cell.meeple-pickable:hover  { transform: translateY(-1px); }
.meeple-cell.meeple-pickable::after {
  content: "✦";
  position: absolute;
  top: 1px; right: 4px;
  font-size: 0.7rem;
  color: #3f73bd;
}
@keyframes oa-meeple-glow {
  0%, 100% {
    box-shadow:
      0 0 0 1px #3f73bd inset,
      0 0 0 2px rgba(63,115,189,0.45),
      0 0 12px rgba(63,115,189,0.45);
  }
  50% {
    box-shadow:
      0 0 0 1px #5b8fd6 inset,
      0 0 0 3px rgba(91,143,214,0.7),
      0 0 22px rgba(91,143,214,0.85);
  }
}

/* ---------- Action bar — horizontal sticky banner under the topbar */
.action-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(540px, 0.9fr);
  align-items: stretch;
}
/* Hide entirely only when both action panel hidden AND no meeples to show.
   In practice we always show meeples for a human player. */
.action-bar:has(#actionPanel[style*="display: none"]):has(#actionBarMeeples:empty) {
  display: none;
}
/* When action panel is hidden, only the meeple strip shows — stretch it across */
.action-bar:has(#actionPanel[style*="display: none"]) {
  grid-template-columns: minmax(0, 1fr);
}
.action-bar:has(#actionPanel[style*="display: none"]) #actionPanel { display: none; }
.action-bar:has(#actionPanel[style*="display: none"]) #actionBarMeeples {
  background: linear-gradient(180deg, #fff8d8 0%, #efd693 100%);
  border-bottom: 3px solid var(--oa-rubric-soft);
  box-shadow: 0 4px 14px rgba(108,24,16,0.10);
  border-left: none;
}
/* Suppress the extra topbar rule when the action bar follows it,
   to avoid the visible "double red line" effect. */
.topbar:has(+ .action-bar #actionPanel:not([style*="display: none"]))::after {
  display: none;
}

.action-bar #actionPanel.action-panel-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  border: none;
  border-bottom: 3px solid var(--oa-rubric);
  border-radius: 0;
  padding: 12px 22px 12px 28px;
  background:
    linear-gradient(180deg, #fff8d8 0%, #efd693 100%);
  box-shadow:
    0 4px 14px rgba(108,24,16,0.18),
    0 1px 0 rgba(255,255,255,0.55) inset;
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.action-bar #actionPanel.action-panel-inline::before { content: none; }

.action-bar .action-panel-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  padding: 0 14px 0 0;
  border-right: 1px solid var(--oa-rubric-soft);
  flex: 0 0 auto;
  min-height: 38px;
}
.action-bar .action-panel-header h2 {
  font-family: "EB Garamond", "Cardo", serif;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--oa-rubric-deep);
  font-size: 1.3rem;
  border: none;
  padding: 0;
  margin: 0;
  white-space: nowrap;
}
.action-bar .action-panel-header h2::before {
  content: "✦ ";
  color: var(--oa-rubric);
  font-size: 0.85em;
  margin-right: 2px;
}

.action-bar .action-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  flex: 0 0 auto;
}
.action-bar .action-filter-btn {
  font-size: 1.02rem;
  font-weight: 700;
  padding: 6px 14px;
  font-variant: small-caps;
  letter-spacing: 0.04em;
}

.action-bar .action-list {
  display: flex !important;
  flex-wrap: wrap;
  gap: 7px !important;
  max-height: none;
  overflow: visible;
  flex: 1 1 320px;
  margin: 0;
}
.action-bar .action-btn {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 10px 18px;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: 0.005em;
}
.action-bar .action-list:has(> :nth-child(10)) { max-height: 38vh; overflow-y: auto; padding-right: 6px; }

/* Wizard mode (after picking a filter) — make choices fill the bar's
   horizontal space instead of clumping on the left. */
.action-bar .action-list .wizard-breadcrumb,
.action-bar .action-list .wizard-step-label,
.action-bar .action-list .wizard-choices {
  flex: 1 1 100%;
  min-width: 0;
}
.action-bar .wizard-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.action-bar .wizard-step-label {
  font-family: "EB Garamond", serif;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--oa-rubric);
  margin: 0;
}
.action-bar .wizard-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 36vh;
  overflow-y: auto;
  padding-right: 4px;
}
.action-bar .wizard-choice-btn {
  font-family: "EB Garamond", serif;
  font-size: 1.08rem;
  font-weight: 600;
  padding: 11px 14px;
  border-radius: 3px;
  background: var(--oa-vellum);
  border: 1px solid var(--oa-line);
  border-left: 4px solid var(--oa-ink-fade);
  color: var(--oa-ink);
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.action-bar .wizard-choice-btn:hover {
  background: #faecc7;
  border-color: var(--oa-gold);
  box-shadow: 0 0 0 1px var(--oa-gold) inset;
  transform: translateY(-1px);
}

/* Persistent meeple strip on the right of the action bar */
.action-bar-meeples {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
  padding: 8px 18px 8px 14px;
  border-bottom: 3px solid var(--oa-rubric);
  background: linear-gradient(180deg, #fff8d8 0%, #efd693 100%);
  border-left: 1px solid var(--oa-rubric-soft);
  min-width: 0;
}
.action-bar-meeples:empty { display: none; }

.ab-meeple {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 5px 8px 5px 6px;
  background: var(--oa-vellum);
  border: 1px solid var(--oa-line);
  border-radius: 4px;
  font-family: "EB Garamond", serif;
  position: relative;
  transition: transform 0.1s, border-color 0.12s;
  min-width: 0;
}
.ab-meeple-info { display: flex; flex-direction: column; min-width: 0; }
.ab-meeple-icon { line-height: 0; display: flex; justify-content: center; }
.ab-meeple-icon .meeple-icon { width: 26px; height: 26px; color: var(--oa-ink); }
.ab-meeple.is-free .ab-meeple-icon .meeple-icon { color: var(--player-color, var(--oa-ink)); }
.ab-meeple-label {
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--oa-ink-soft);
  line-height: 1;
  margin-bottom: 2px;
}
.ab-meeple-state {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid currentColor;
}

/* State backgrounds — colored pills for legibility */
.ab-meeple-state.meeple-state-free {
  color: #1d4a2f;
  background: #d4ead9;
  border-color: #a4cbb0;
  font-variant: small-caps;
  letter-spacing: 0.05em;
}
.ab-meeple-state.meeple-state-track {
  color: #142a44;
  background: #d2dff0;
  border-color: #99b3d4;
}
.ab-meeple-state.meeple-state-supervision {
  color: #3a1c64;
  background: #e3d5f4;
  border-color: #b89cdb;
}
.ab-meeple-state.meeple-state-en_obras {
  color: #5d4308;
  background: #f3e3b5;
  border-color: #c8a64a;
}
.ab-meeple-state.meeple-state-taberna {
  color: #5a2f10;
  background: #ecd5be;
  border-color: #b88a64;
}
.ab-meeple-state.meeple-state-private,
.ab-meeple-state.meeple-state-other {
  color: #463a26;
  background: #e5dcc6;
  border-color: #b8a781;
}

/* When this meeple is pickable, blue glow */
.ab-meeple.meeple-pickable {
  cursor: pointer;
  background: linear-gradient(180deg, #e9f1fb 0%, #cbddf2 100%);
  border-color: #3f73bd;
}
.ab-meeple.meeple-pickable .ab-meeple-icon .meeple-icon { color: #1f3658; }
.ab-meeple.meeple-pickable.is-free .ab-meeple-icon .meeple-icon { color: var(--player-color, #1f3658); }
.ab-meeple.meeple-pickable .ab-meeple-label { color: #1f3658; }
.ab-meeple.meeple-pickable .ab-meeple-state { color: #2a4263; }
.ab-meeple.meeple-pickable:hover { transform: translateY(-2px); }
.ab-meeple.meeple-pickable {
  animation: oa-meeple-glow 1.3s ease-in-out infinite;
}

/* Hide the meeples row inside the player card (now lives in the action bar) */
.tu-panel .meeples,
.tu-panel .sub:has(+ .meeples) { display: none; }

/* Meeple-step choices: render as big SVG figures in the action bar.
   Triggered by body.picking-meeple. */
body.picking-meeple .action-bar .wizard-choices {
  grid-template-columns: repeat(auto-fit, minmax(120px, 140px));
  justify-content: flex-start;
  gap: 14px;
  padding: 8px 4px 4px;
  max-height: none;
}
body.picking-meeple .action-bar .wizard-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px 8px;
  background:
    radial-gradient(circle at 50% 30%, #e9f1fb 0%, #cbddf2 80%);
  border: 1.5px solid #3f73bd !important;
  border-left: 1.5px solid #3f73bd !important;
  color: #1f3658;
  font-family: "EB Garamond", serif;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 4px;
  animation: oa-meeple-glow 1.4s ease-in-out infinite;
  cursor: pointer;
}
body.picking-meeple .action-bar .wizard-choice-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}
body.picking-meeple .action-bar .wizard-meeple-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
body.picking-meeple .action-bar .wizard-meeple-choice .meeple-icon {
  width: 64px;
  height: 64px;
  color: #1f3658;
  filter: drop-shadow(0 2px 4px rgba(31,54,88,0.25));
}

/* When picking a meeple, the duplicate wizard buttons inside the action panel
   are unneeded — the persistent meeple strip on the right is the click target. */
body.picking-meeple .action-bar #actionPanel .wizard-choices,
body.picking-meeple .action-bar #actionPanel .wizard-step-label { display: none; }
body.picking-meeple .action-bar-meeples::before {
  content: "Elige meeple";
  position: absolute;
  top: -22px;
  left: 18px;
  font-family: "EB Garamond", serif;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--oa-rubric);
}
body.picking-meeple .action-bar-meeples { position: relative; }
.action-bar .wizard-cancel-btn {
  font-family: "EB Garamond", serif;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 1rem;
  padding: 11px 18px;
  border-radius: 3px;
  border: 1px solid var(--oa-rubric-deep);
  background: linear-gradient(180deg, var(--oa-rubric) 0%, var(--oa-rubric-deep) 100%);
  color: #fbecd2;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 2px 4px rgba(108,24,16,0.25);
  transition: filter 0.12s, transform 0.08s;
}
.action-bar .wizard-cancel-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* Confirmar / Cancelar grouped together at the bottom of the wizard */
.action-bar .wizard-confirm-actions {
  display: flex;
  gap: 0;
  margin-top: 4px;
  align-items: stretch;
}
.action-bar .wizard-confirm-actions .wizard-confirm-btn {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
  flex: 0 1 auto;
  min-width: 200px;
  font-size: 1.14rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 11px 22px;
  background: linear-gradient(180deg, #fff8d8 0%, #efd693 100%);
  border: 2px solid var(--oa-gold);
  color: var(--oa-ink);
  position: relative;
  animation: oa-confirm-glow 1.6s ease-in-out infinite;
}
.action-bar .wizard-confirm-actions .wizard-confirm-btn::before {
  content: "✦ ";
  color: var(--oa-rubric);
  margin-right: 4px;
}
.action-bar .wizard-confirm-actions .wizard-confirm-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.action-bar .wizard-confirm-actions .wizard-cancel-btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 1px solid rgba(255,255,255,0.35);
}
@keyframes oa-confirm-glow {
  0%, 100% {
    box-shadow:
      0 0 0 1px var(--oa-gold) inset,
      0 0 0 2px var(--oa-gold-bright),
      0 0 14px rgba(184,146,59,0.5);
  }
  50% {
    box-shadow:
      0 0 0 1px var(--oa-gold-bright) inset,
      0 0 0 3px var(--oa-gold-bright),
      0 0 26px rgba(227,185,88,0.85);
  }
}
.action-bar .wizard-crumb {
  font-family: "EB Garamond", serif;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-weight: 700;
  font-size: 1rem;
  padding: 4px 10px;
  border-radius: 3px;
  border: 1px solid currentColor;
  background: var(--oa-vellum);
}

/* Legacy inline action-panel inside the right column is no longer used,
   but keep its visual fallback minimal in case markup changes. */
.right-col .action-panel-inline {
  border: 2px solid var(--oa-rubric);
  border-radius: 4px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fffbe8 0%, #f8e9c4 100%);
}
.action-panel-header h2 {
  font-family: "EB Garamond", "Cardo", serif;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--oa-rubric-deep);
  font-size: 1.1rem;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.action-filter-btn {
  font-family: "EB Garamond", serif;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  padding: 4px 11px;
  border-radius: 3px;
  border: 1px solid var(--oa-line);
  background: var(--oa-vellum);
  color: var(--oa-ink-soft);
}
.action-filter-btn.active {
  background: var(--oa-rubric);
  border-color: var(--oa-rubric-deep);
  color: #fbecd2;
}

/* Hide the duplicated player-state strip inside the action panel.
   Resources, hand and meeples live in the Tú card below — no need
   to render them twice. */
#actionPanel #playerInfo,
#actionPanel .player-info-strip { display: none !important; }
.action-panel-header { margin-bottom: 6px; }

.action-list { gap: 8px !important; }
.action-btn {
  font-family: "EB Garamond", serif;
  font-size: 1.08rem;
  line-height: 1.35;
  padding: 12px 15px;
  border-radius: 3px;
  border: 1px solid var(--oa-line);
  background: var(--oa-vellum);
  color: var(--oa-ink);
  position: relative;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
  cursor: pointer;
}
.action-btn::before {
  content: "❧";
  color: var(--oa-rubric);
  margin-right: 7px;
  font-size: 0.9em;
  vertical-align: -1px;
}
.action-btn:hover {
  background: #faecc7;
  border-color: var(--oa-gold);
  box-shadow: 0 0 0 1px var(--oa-gold) inset;
  transform: translateY(-1px);
}
.action-btn.type-pasar {
  background: var(--oa-vellum);
  border-color: var(--oa-line-soft);
  color: var(--oa-ink-fade);
  font-style: italic;
}
.action-btn.type-pasar::before { content: "—"; color: var(--oa-ink-fade); }

/* When NOT your turn, dim the inline action panel softly */
.action-panel-inline:has(.action-list:empty),
.action-panel-inline.is-waiting {
  opacity: 0.55;
  filter: saturate(0.7);
}

/* ---------- Current turn glow → gold leaf, not teal --------------- */
.player.is-current-turn,
.rival-card.is-current-turn {
  border-color: var(--oa-gold) !important;
  box-shadow:
    0 0 0 2px var(--oa-gold),
    0 0 18px rgba(184,146,59,0.55) !important;
  animation: oa-turn-pulse 2.6s ease-in-out infinite !important;
}
@keyframes oa-turn-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--oa-gold), 0 0 12px rgba(184,146,59,0.35); }
  50%      { box-shadow: 0 0 0 2px var(--oa-gold-bright), 0 0 26px rgba(227,185,88,0.75); }
}

/* ---------- Objective cards (active/completed) -------------------- */
.obj-card {
  font-family: "EB Garamond", serif;
  font-size: 0.92rem;
  padding: 9px 11px;
  border-radius: 3px;
  background: var(--oa-vellum);
  border: 1px solid var(--oa-line);
  position: relative;
}
.obj-active {
  border: 1px solid var(--oa-gold);
  background:
    linear-gradient(135deg, #fff7d6 0%, #f0dca4 100%);
}
.obj-active::before {
  content: "";
  position: absolute;
  top: 8px; right: 8px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e3b958 0%, #8c6a1f 75%, #4a3608 100%);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.18) inset, 0 1px 1px rgba(0,0,0,0.25);
}
.obj-completed {
  border-color: #6fa77b;
  background: linear-gradient(135deg, #f0f8ed 0%, #d7ebd1 100%);
}
.obj-completed .obj-card-name {
  color: #245f32;
}
.obj-completed .obj-pp-chip {
  background: #3f7d4b;
  border-color: #275d34;
  color: #f3fbef;
}
.obj-check {
  box-shadow: 0 0 0 1px rgba(32,82,42,0.18) inset, 0 1px 1px rgba(0,0,0,0.12);
}

/* ---------- Objective market cards -------------------------------- */
.obj-market { gap: 10px; }
.obj-market-card {
  border: 1px solid var(--oa-gold);
  border-radius: 4px;
  background: linear-gradient(180deg, #fdf2cf 0%, #f3deaa 100%);
  padding: 12px 14px;
}
.obj-market-card.pickable {
  border-color: var(--oa-rubric);
  box-shadow: 0 0 0 2px rgba(139,31,21,0.18);
}
.obj-market-name {
  font-family: "EB Garamond", "Cardo", serif;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  font-weight: 700;
  font-size: 1.18rem;
  color: var(--oa-ink);
}
.obj-market-desc {
  font-family: "EB Garamond", serif;
  font-style: italic;
  color: var(--oa-ink-soft);
  font-size: 1.02rem;
  line-height: 1.4;
}
.obj-pp-chip { font-size: 0.92rem; padding: 3px 9px; }
/* Player's own objective cards (active / completed) */
.obj-card { font-size: 1rem; line-height: 1.4; }
.obj-card-name { font-size: 1.05rem; font-variant: small-caps; letter-spacing: 0.04em; }
.obj-pp-chip {
  background: var(--oa-rubric);
  color: #fbecd2;
  border: 1px solid var(--oa-rubric-deep);
  border-radius: 3px;
  font-family: "IBM Plex Mono", monospace;
  font-feature-settings: "tnum" 1;
  font-weight: 700;
}

/* ---------- Market strip items ------------------------------------ */
.market-strip-item {
  background: var(--oa-vellum);
  padding: 12px 14px;
}
.market-strip-item h3 {
  font-size: 0.95rem;
  margin-top: 0;
}
#deckCount { font-size: 1.6rem; color: var(--oa-ink); }

/* ---------- Discard list ------------------------------------------ */
.discard {
  font-family: "EB Garamond", serif;
  font-size: 0.9rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.discard li { padding: 3px 0; border-bottom: 1px dotted var(--oa-line-soft); color: var(--oa-ink-soft); }
.discard li strong { color: var(--oa-rubric); margin-right: 6px; font-weight: 700; }

/* ---------- Rivals --------------------------------------------------*/
.rivals-head { font-size: 1.1rem; }
.rival-card { padding: 11px 13px; background: var(--oa-vellum); }
.rival-card .player-name { font-size: 1.1rem; }

/* ---------- Phase summary feed ------------------------------------ */
.phase-summary-feed {
  font-family: "EB Garamond", serif;
  font-size: 0.92rem;
  color: var(--oa-ink-soft);
  line-height: 1.5;
}
.phase-summary-feed > * + * {
  border-top: 1px dotted var(--oa-line-soft);
  padding-top: 6px;
  margin-top: 6px;
}

/* ---------- Scrollbars (webkit) ----------------------------------- */
.tu-panel::-webkit-scrollbar,
.action-list::-webkit-scrollbar,
.phase-summary-feed::-webkit-scrollbar { width: 9px; }
.tu-panel::-webkit-scrollbar-thumb,
.action-list::-webkit-scrollbar-thumb,
.phase-summary-feed::-webkit-scrollbar-thumb {
  background: var(--oa-line);
  border-radius: 999px;
}
.tu-panel::-webkit-scrollbar-track,
.action-list::-webkit-scrollbar-track,
.phase-summary-feed::-webkit-scrollbar-track {
  background: rgba(184,156,106,0.15);
}

/* ---------- Tablero / cards on board ------------------------------ */
.player.is-current-turn { background: linear-gradient(180deg, #fff5cf 0%, #f3e2a8 100%); }

/* keep board cards readable: don't override sizes/positions, only
   the visual chrome */
.board article {
  background: var(--oa-vellum) !important;
  border: 1px solid var(--oa-line) !important;
  border-radius: 4px !important;
}
.board article .card-title,
.board article .card-name,
.board article .nombre {
  font-family: "EB Garamond", "Cardo", serif !important;
  font-variant: small-caps;
}

/* Slightly bigger board-card text for legibility */
.board .card-title { font-size: 1.05rem; line-height: 1.18; }
.board .card-owner { font-size: 0.85rem; }
.board .card-coord { font-size: 0.78rem; }
.board .card-cost-line,
.board .card-cost-pill { font-size: 0.86rem; }
.board .effect-text { font-size: 0.92rem; line-height: 1.35; }
.board .mini-label { font-size: 0.82rem; }
.board .pp-chip { font-size: 0.95rem; width: 34px; height: 34px; }

/* Hand item text inside Tú panel — also a bit bigger */
.hand-item { font-size: 1rem; padding: 7px 10px; }

/* ---------- Reference drawer (Mazo + Descarte + Mercado de Objetivos) */
.ref-toggle-btn {
  font-family: "EB Garamond", serif;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  font-weight: 600;
  font-size: 0.86rem;
  padding: 6px 14px;
  border: 1px solid var(--oa-gold);
  background: linear-gradient(180deg, #fdf2cf 0%, #f0d995 100%);
  color: #5d4710;
  border-radius: 4px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.08s;
}
.ref-toggle-btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
.ref-toggle-btn[aria-expanded="true"] {
  background: linear-gradient(180deg, var(--oa-rubric) 0%, var(--oa-rubric-deep) 100%);
  color: #fbecd2;
  border-color: var(--oa-rubric-deep);
}

.ref-backdrop {
  position: fixed; inset: 0;
  background: rgba(20,16,8,0.45);
  backdrop-filter: blur(2px);
  z-index: 200;
  animation: oa-fade-in 0.18s ease-out;
}
@keyframes oa-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ref-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: min(560px, 92vw);
  z-index: 201;
  background:
    linear-gradient(180deg, #fdf6dd 0%, #f0e2b6 100%),
    var(--oa-paper);
  border-right: 3px solid var(--oa-gold);
  box-shadow: 8px 0 24px rgba(40,24,4,0.25);
  display: flex;
  flex-direction: column;
  animation: oa-drawer-in 0.22s cubic-bezier(0.22, 0.8, 0.32, 1);
}
.ref-drawer[hidden] { display: none; }
@keyframes oa-drawer-in {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

.ref-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 2px solid var(--oa-rubric-soft);
  background:
    linear-gradient(180deg, rgba(255,250,234,0.85) 0%, transparent 100%);
}
.ref-drawer-head h2 {
  margin: 0;
  font-family: "EB Garamond", "Cardo", serif;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--oa-rubric);
  font-size: 1.4rem;
  border: none;
  padding: 0;
}
.ref-drawer-head h2::first-letter {
  color: var(--oa-rubric-deep);
  font-size: 1.4em;
}
.ref-close {
  border: 1px solid var(--oa-line);
  background: var(--oa-vellum);
  color: var(--oa-ink-soft);
  width: 32px;
  height: 32px;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
}
.ref-close:hover { background: rgba(139,31,21,0.08); border-color: var(--oa-rubric); color: var(--oa-rubric); }

.ref-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ref-drawer-body .market-strip-item {
  background: var(--oa-vellum);
  border: 1px solid var(--oa-line);
  border-radius: 4px;
  padding: 14px 16px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.55) inset;
}
.ref-drawer-body .market-strip-item h3 {
  font-family: "EB Garamond", "Cardo", serif;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  color: var(--oa-rubric);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 10px 0;
  border-bottom: 1px solid var(--oa-rubric-soft);
  padding-bottom: 5px;
}
.ref-drawer-body .obj-market {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.ref-drawer-body .deck-box {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ref-drawer-body #deckCount { font-size: 1.8rem; }

body.ref-drawer-open { overflow: hidden; }

/* ---------- Layout: keep 2 columns down to ~820px ----------------- */
@media (min-width: 820px) {
  .layout-v2 {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px) !important;
  }
  .right-col {
    position: sticky !important;
    top: 14px;
    align-self: start;
  }
  .tu-panel {
    max-height: calc(100vh - 28px);
    overflow-y: auto;
  }
}
@media (max-width: 819px) {
  /* When truly narrow, action/Tu first */
  .layout-v2 { display: flex !important; flex-direction: column; }
  .right-col { order: -1 !important; }
}

/* ---------- Night mode tweaks ------------------------------------- */
body.phase-night {
  background:
    radial-gradient(ellipse at 22% 18%, rgba(60,40,80,0.45) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(184,146,59,0.10) 0%, transparent 55%),
    #14131c !important;
}
body.phase-night::before { opacity: 0.35; }
body.phase-night .topbar h1 { color: #f3e8c8; text-shadow: 0 0 14px rgba(184,146,59,0.35); }
body.phase-night .topbar h1::first-letter { color: var(--oa-gold-bright); }
body.phase-night .panel,
body.phase-night .subpanel,
body.phase-night .tu-panel,
body.phase-night .market-strip-item,
body.phase-night .rivals-section,
body.phase-night .player,
body.phase-night .rival-card,
body.phase-night .obj-market-card {
  background: #1c1a25 !important;
  border-color: #3a3447 !important;
  color: #ece2c6;
}
body.phase-night .panel h2,
body.phase-night .subpanel h2,
body.phase-night .tu-head h2,
body.phase-night .rivals-head,
body.phase-night .market-strip-item h3 { color: var(--oa-gold-bright) !important; border-bottom-color: rgba(227,185,88,0.25); }
body.phase-night .player-name,
body.phase-night .obj-market-name { color: #f1e6c4; }
body.phase-night .res {
  background: radial-gradient(circle at 50% 35%, #2a2632 0%, #1a1721 80%) !important;
  border-color: #3a3447 !important;
  color: #f1e6c4;
}
body.phase-night .hand-item {
  background: #221f2c;
  border-color: #3a3447;
  color: #ece2c6;
}

/* Night mode: action bar (sticky top) — was hard-coded cream, override to dark */
body.phase-night .action-bar #actionPanel.action-panel-inline,
body.phase-night .action-bar:has(#actionPanel[style*="display: none"]) #actionBarMeeples {
  background: linear-gradient(180deg, #2a2632 0%, #1a1721 100%);
  border-bottom-color: rgba(184, 146, 59, 0.55);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
body.phase-night .action-bar .action-panel-header h2 {
  color: var(--oa-gold-bright);
}
body.phase-night .action-bar .action-panel-header {
  border-right-color: rgba(227, 185, 88, 0.25);
}
body.phase-night .action-filter-btn,
body.phase-night .action-list .action-item,
body.phase-night .action-status,
body.phase-night .wizard-hint {
  color: #ece2c6;
}
body.phase-night .ab-meeple {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(227, 185, 88, 0.2);
}
body.phase-night .ab-meeple-label,
body.phase-night .ab-meeple-state {
  color: #ece2c6;
}

/* Night mode: phase summary feed — improve text contrast */
body.phase-night .phase-text {
  color: #e8e0c8;
}
body.phase-night .phase-head {
  color: #c8c4ad;
}
body.phase-night .phase-row + .phase-row {
  border-top-color: #3a3447;
}

/* Night mode: command feed last-event text */
body.phase-night .cmd-text,
body.phase-night #lastEvent {
  color: #e8e0c8;
}

/* ===== Meeple flight animation ===== */
.meeple-flying { display: block; }
#meepleAnimToggle.is-on { background: rgba(80, 140, 95, 0.18); border-color: rgba(80, 140, 95, 0.6); }
.meeple-incoming { visibility: hidden; }

/* Conseguidor remaining resources inside rival objective chip */
.rival-obj-chip .rival-obj-tokens { display: inline-flex; gap: 3px; margin-left: 4px; align-items: center; vertical-align: middle; }
.rival-obj-chip .rival-obj-tokens .token-list { display: inline-flex; gap: 3px; align-items: center; }

/* Prevent rival-card grid track from being forced wider by max-content children */
.rival-card { min-width: 0; }
.rival-card > * { min-width: 0; }
.rival-meeple span { max-width: 100%; }

/* Hover preview: large floating image of a card/objective illustration */
#cardZoom {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease;
}
#cardZoom.visible {
  opacity: 1;
  visibility: visible;
}
#cardZoom img {
  display: block;
  max-height: 78vh;
  max-width: 44vw;
  border-radius: 10px;
  border: 1px solid rgba(20, 12, 4, .55);
  box-shadow: 0 14px 44px rgba(0, 0, 0, .55);
  background: #1a140c;
}
.card-illus,
.obj-illus,
.obj-illus-sm,
.preview-obj-illus {
  cursor: zoom-in;
}
