/* Стилізовані карти Too Many Bones */
:root { --card-w: 360px; --card-h: 500px; }

.card {
  position: relative;
  width: var(--card-w); height: var(--card-h);
  border-radius: 16px;
  overflow: hidden;
  color: var(--ink);
  font: 500 15px/1.28 'Alegreya Sans', sans-serif;
  box-shadow: 0 8px 20px rgba(0,0,0,.5);
  flex: none;
}
.card .fit { overflow: hidden; }
.card p { margin: 0 0 .45em; }
.card p:last-child { margin-bottom: 0; }
.card .c { text-align: center; }
.card .ind { margin-left: 1.1em; }
.card .ind.ind { }
.card .sm { font-size: .84em; }
.card .purple { color: #5b2a8c; }
.card .red { color: #a3261b; }
.card .quote { font-style: italic; font-size: .82em; margin-top: .6em; }
.card .n { font-weight: 400; }
.card h4.sec { margin: .55em 0 .25em; font: 800 1.12em 'Alegreya', serif; }
.card ul { margin: .2em 0 .45em; padding-left: 1.2em; }
.card hr { border: 0; border-top: 1.5px solid rgba(43,36,32,.6); margin: .5em 0; }
.card table { border-collapse: collapse; margin: .3em auto .5em; font-size: .9em; }
.card td, .card th { padding: .12em .35em; vertical-align: middle; text-align: left; }

/* ---------- іконки ---------- */
.ic {
  --s: 1.15em;
  position: relative;
  display: inline-block;
  width: var(--s); height: var(--s);
  vertical-align: -.22em;
  line-height: 0;
}
.ic svg { width: 100%; height: 100%; display: block; }
.ic > b {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font: 800 calc(var(--s) * .5)/1 'Alegreya', serif;
  color: #2b2420;
  padding-bottom: .06em;
}
.ic-gear-dark > b, .ic-sun-dark > b { color: #f4efe6; font-size: calc(var(--s) * .55); }
.ic-atk > b, .ic-def > b { font-size: calc(var(--s) * .55); }
.ic-def > b { color: #f2d57a; }
.ic-uses > b { font-size: calc(var(--s) * .4); }

/* ---------- пергамент ---------- */
.parch {
  background:
    var(--blots),
    var(--noise),
    radial-gradient(ellipse at 50% 45%, #f6efdc 0%, #ece0c2 65%, #d9c69c 100%);
}

/* ========== ЛИЦЕ ПОДІЇ ========== */
.card--encounter-front {
  background:
    var(--noise),
    radial-gradient(ellipse at 50% 85%, rgba(140,120,60,.45), transparent 60%),
    linear-gradient(180deg, #2c241e 0%, #3e4a2c 35%, #2f3a24 75%, #4a3a22 100%);
  padding: 14px;
}
.card--encounter-front::before, .card--encounter-front::after {   /* труби по краях */
  content: ''; position: absolute; top: 40px; bottom: 30px; width: 7px; border-radius: 4px;
  background: linear-gradient(90deg, #6e6a5e, #d8d3c0 45%, #6e6a5e);
  box-shadow: 0 0 4px rgba(0,0,0,.6);
}
.card--encounter-front::before { left: 12px; }
.card--encounter-front::after { right: 12px; }
.kind-special .card--encounter-front, .card--encounter-front.kind-special {
  background: var(--noise), radial-gradient(ellipse at 50% 85%, rgba(160,110,50,.5), transparent 60%),
    linear-gradient(180deg, #2a1d16 0%, #6a3c22 40%, #4a2a18 75%, #5a4228 100%);
}
.card--encounter-front.kind-tyrant {
  background: var(--noise), radial-gradient(ellipse at 50% 50%, rgba(120,170,200,.35), transparent 70%),
    linear-gradient(180deg, #14232e 0%, #2d5970 40%, #1d3c50 75%, #142430 100%);
}
.cf-banner {
  position: relative; z-index: 2;
  margin: 2px 6px 0;
  text-align: center;
  font: 34px/0.95 'Rye', serif;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #e0532f;
  background: linear-gradient(180deg, #ffb070 0%, #e0532f 45%, #8e1f12 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 1px #2a0d06) drop-shadow(0 2px 0 #2a0d06) drop-shadow(0 0 5px rgba(0,0,0,.7));
}
.cf-banner.long { font-size: 27px; }
.cf-panel {
  position: absolute; left: 26px; right: 26px; top: 66px; bottom: 50px;
  padding: 20px 18px 20px;
  clip-path: var(--torn);
  text-align: center;
}
.cf-banner.long + .cf-panel { top: 86px; }
.cf-title { font: 800 1.12em/1.15 'Alegreya', serif; margin-bottom: .45em; }
.cf-panel p { margin-bottom: .55em; }
.cf-footer {
  position: absolute; left: 0; right: 0; bottom: 14px;
  text-align: center; font: 600 11px 'Exo 2', sans-serif; color: #eee6d4;
  text-shadow: 0 1px 2px #000;
}
.cf-footer .ic { --s: 1.3em; }
.cf-badge { position: absolute; right: 12px; bottom: 8px; }
.cf-badge .ic { --s: 40px; }
.cf-corner-tl { position: absolute; left: 12px; top: 10px; z-index: 3; }
.cf-corner-tl .ic, .cf-corner-tr .ic { --s: 18px; }
.cf-corner-tr { position: absolute; right: 12px; top: 10px; z-index: 3; }

/* ========== ЗВОРОТ ПОДІЇ ========== */
.card--encounter-back { font: 700 15px/1.22 'Alegreya', serif; }
.card--encounter-back .cb-body { position: absolute; left: 16px; right: 14px; top: 12px; bottom: 50px; }
.cb-foot {
  position: absolute; left: 12px; right: 12px; bottom: 8px;
  display: flex; justify-content: space-between; align-items: flex-end;
}
.cb-foot .ic { --s: 34px; margin-left: 3px; }
.cb-foot .ic-loot, .cb-foot .ic-trove { --s: 46px; }
.cb-gearbg {   /* бліді шестерні на тлі */
  position: absolute; left: 10%; top: 38%; width: 80%; aspect-ratio: 1; opacity: .07; pointer-events: none;
}

.choice { position: relative; padding-right: 2.9em; margin-bottom: .75em; }
.ch-top {
  display: flex; align-items: flex-end; gap: .3em;
  margin-right: -0.4em;
  border-bottom: 1.6px solid #2b2420;
  min-height: 1.35em;
  margin-bottom: .25em;
}
.ch-pre .ic { --s: 1.05em; margin-right: .1em; }
.ch-label { margin-left: auto; margin-right: 2.6em; font: 500 .82em/1.2 'Exo 2', sans-serif; }
.ch-side {
  position: absolute; right: -.2em; top: -.25em;
  display: flex; flex-direction: column; align-items: center; gap: .12em;
}
.ch-side .ic { --s: 2.35em; }
.ch-side .ic-battle, .ch-side .ic-nonbattle { --s: 2.2em; margin-bottom: -.15em; position: relative; left: .25em; }
.ch-side .ic-loot, .ch-side .ic-trove { border: 1.6px solid #2b2420; border-radius: 50%; background: rgba(243,234,214,.6); padding: .2em; }
.ch-title { font: 800 1.04em/1.18 'Alegreya', serif; margin-bottom: .3em; }
.choice p { margin-bottom: .35em; }
.choice .ind { margin-left: 1.2em; }

.die { display: flex; gap: .5em; align-items: flex-start; margin: .3em 0 .45em; }
.die > .ic { --s: 2.1em; flex: none; }
.die > div { flex: 1; }

/* ========== ТИРАН: ПОРТРЕТ ========== */
.card--tyrant-portrait {
  background: var(--noise),
    radial-gradient(ellipse at 40% 30%, #b8d4e4 0%, #6a8fb8 35%, #4a3c7a 70%, #2a1f45 100%);
}
.set-rage .card--tyrant-portrait, .card--tyrant-portrait.set-rage {
  background: var(--noise), radial-gradient(ellipse at 40% 30%, #e06a4a 0%, #b02a1e 40%, #6a1410 80%, #3a0a08 100%);
}
.tp-banner {
  position: absolute; left: 0; right: 0; top: 10px; z-index: 3; text-align: center;
  font: 40px/0.9 'Rye', serif; text-transform: uppercase;
  background: linear-gradient(180deg, #fff3a0 0%, #c6d84a 40%, #4a6a1a 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 1px #111) drop-shadow(0 2px 0 #111) drop-shadow(0 0 4px rgba(0,0,0,.8));
}
.set-rage .tp-banner { background-image: linear-gradient(180deg, #e8f4ff, #7ab4e8 50%, #1e4a8a); -webkit-background-clip: text; background-clip: text; }
.tp-banner small { display: block; font-size: .42em; margin-top: 2px; }
.tp-banner.long { font-size: 31px; }
.tp-text {
  position: absolute; left: 22px; right: 22px; top: 78px; max-height: 210px; z-index: 2;
  padding: 12px 14px;
  text-align: center;
  font: 500 14px/1.22 'Alegreya Sans', sans-serif;
  clip-path: var(--torn);
}
.tp-art {
  position: absolute; left: 6%; right: 18%; bottom: 26px; height: 50%; z-index: 1;
  background-size: contain; background-repeat: no-repeat; background-position: center bottom;
  -webkit-mask-image: linear-gradient(to top, transparent 0, transparent 12%, #000 36%), radial-gradient(ellipse 62% 64% at 50% 55%, #000 58%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to top, transparent 0, transparent 12%, #000 36%), radial-gradient(ellipse 62% 64% at 50% 55%, #000 58%, transparent 100%);
  mask-composite: intersect;
}
.tp-stats { position: absolute; right: 14px; top: 50%; z-index: 3; display: flex; flex-direction: column; gap: 6px; }
.tp-stats .ic { --s: 52px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.tp-stats .ic svg { background: radial-gradient(circle, #f3ead6 60%, transparent 62%); border-radius: 50%; }
.tp-types { position: absolute; left: 12px; bottom: 12px; z-index: 3; display: flex; gap: 5px; }
.tp-types .ic { --s: 30px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.7)); }
.tp-len { position: absolute; right: 14px; bottom: 10px; z-index: 3; text-align: center; font: 13px 'Marcellus SC', serif; color: #f6ecd2; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.tp-len i { display: inline-block; width: 9px; height: 9px; margin: 0 1px; border-radius: 50%; border: 1.5px solid #8a4a1a; background: #fff3dc; }
.tp-len i.on { background: radial-gradient(circle at 35% 35%, #ffd27a, #d06a12); }

/* ========== ТЕКСТОВІ КАРТИ (битва тирана, shadow, правила, епілог, кампанія, generic) ========== */
.card--text { padding: 0; }
.card--text .tx-body { position: absolute; left: 18px; right: 18px; top: 16px; bottom: 26px; }
.card--text .tx-title {
  font: 25px/1.02 'Marcellus SC', serif; color: #5a1e10; margin-bottom: .3em;
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.card--text .tx-title.big { text-align: center; font-size: 34px; color: #4a3015; }
.card--text .tx-sub { font: 700 .8em 'Alegreya Sans', sans-serif; text-align: center; margin: -.2em 0 .5em; }
.card--text .tx-foot { position: absolute; left: 0; right: 0; bottom: 7px; text-align: center; font: 600 10.5px 'Exo 2', sans-serif; color: #5a4a3a; }
.card--tyrant-battle { font: 700 14.5px/1.22 'Alegreya', serif; }
.card--tyrant-battle .die div, .card--tyrant-battle .sm { font-family: 'Alegreya Sans', sans-serif; font-weight: 500; }
.card--tyrant-battle .ind { margin-left: 1.2em; }
.card--shadow { font: 700 15px/1.25 'Alegreya', serif; }
.card--shadow .tx-title.big { font-size: 40px; line-height: .95; margin: .3em 0 .5em; color: #5b4024; }
.card--shadow .die div { font-family: 'Alegreya Sans', sans-serif; font-weight: 500; }
.card--shadow .parch-grid, .card--shadow.parch {
  background:
    var(--noise),
    repeating-linear-gradient(0deg, transparent 0 15px, rgba(90,70,120,.10) 15px 16px),
    repeating-linear-gradient(90deg, transparent 0 15px, rgba(90,70,120,.10) 15px 16px),
    radial-gradient(ellipse at 50% 45%, #f1ecf4 0%, #ded3e2 70%, #b9a9c0 100%);
}

/* правила: дерев'яна рамка */
.card--rules {
  background: var(--noise),
    repeating-linear-gradient(90deg, rgba(0,0,0,.0) 0 6px, rgba(0,0,0,.12) 6px 8px),
    linear-gradient(180deg, #7a3a1e, #5a2412);
  font: 600 15px/1.28 'Alegreya Sans', sans-serif;
}
.card--rules .tx-body { left: 20px; right: 20px; top: 20px; bottom: 30px; padding: 18px 16px; clip-path: var(--torn); }
.card--rules .tx-title { text-align: center; font: 800 26px/1.05 'Alegreya', serif; color: #3a2010; }
.card--rules h4.sec, .card--rules .tx-title.big { font-family: 'Marcellus SC', serif; font-weight: 400; font-size: 1.6em; text-align: center; }
.card--rules .tx-foot { color: #f0e0c8; text-shadow: 0 1px 2px #000; bottom: 9px; }
.card--rules.set-40d .tx-title { font: 22px 'Kelly Slab', serif; color: #f6e2b0; background: linear-gradient(180deg, #9a6235, #5a3015); border: 2px solid #3a1f0b; border-radius: 8px; padding: .25em .5em; text-shadow: 0 1px 2px #000; }

/* кампанія */
.card--campaign-front {
  background: var(--noise), linear-gradient(180deg, #2a2522, #4b4440 50%, #2a2522);
}
.card--campaign-front .tx-plaque {
  position: absolute; left: 50px; right: 50px; top: 12px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  font: 30px 'Marcellus SC', serif; color: #3a1d0c;
  background: radial-gradient(ellipse at 50% 30%, #f4d690, #c89b4a 60%, #7a5420);
  border: 3px solid #4a3010; border-radius: 10px;
  box-shadow: inset 0 0 8px rgba(0,0,0,.4), 0 3px 6px rgba(0,0,0,.6);
}
.card--campaign-front .tx-body {
  left: 30px; right: 30px; top: 78px; bottom: 34px; padding: 14px 14px;
  text-align: center; font: 500 14px/1.22 'Alegreya Sans', sans-serif;
  border: 4px solid #6a5a4a; border-radius: 4px;
  box-shadow: inset 0 0 10px rgba(80,60,40,.4);
}
.card--campaign-front .tx-foot { color: #e8e0d4; text-shadow: 0 1px 2px #000; bottom: 10px; }
.card--campaign-front .tx-title { text-align: center; font: 800 1.1em 'Alegreya', serif; color: #2b2420; }
.card--campaign-back { font: 500 14px/1.25 'Alegreya Sans', sans-serif; }
.card--campaign-back .tx-body { right: 54px; }
.camp-tab {
  position: absolute; right: 0; top: 0; bottom: 0; width: 46px;
  background: var(--noise), linear-gradient(90deg, #8a8a8e, #6a6a70);
  border-left: 3px double #3a3a40;
  display: flex; align-items: center; justify-content: center;
}
.camp-tab span { transform: rotate(90deg); white-space: nowrap; font: 24px 'Marcellus SC', serif; color: #3a3a40; letter-spacing: .05em; }
.camp-title { background: #2a2828; color: #f0ece4; font: 600 1.15em 'Exo 2', sans-serif; text-align: center; padding: .45em .5em; margin-bottom: .5em; border-radius: 3px; }
.camp-reward { display: flex; gap: .5em; margin-bottom: .6em; }
.camp-k { flex: none; width: 5.2em; background: #2a2828; color: #f0ece4; font: 600 .85em/1.1 'Exo 2', sans-serif; padding: .4em; border-radius: 3px; display: flex; align-items: center; }
.camp-v { flex: 1; padding: .3em 0; }
.camp-v .ic { --s: 1.8em; float: left; margin: 0 .4em .2em 0; }
table.camp { width: 100%; border-collapse: collapse; font-size: .84em; table-layout: fixed; }
table.camp th:nth-child(n+5), table.camp td:nth-child(n+5) { width: 2.4em; }
table.camp th { background: #2a2828; color: #f0ece4; font: 600 .8em/1.1 'Exo 2', sans-serif; padding: .35em .1em; overflow-wrap: anywhere; text-align: center; border: 1px solid #555; }
table.camp th .ic { --s: 1.8em; filter: invert(1) brightness(1.3); }
table.camp td { border: 1px solid #6a6460; padding: .3em .12em; overflow-wrap: anywhere; text-align: center; vertical-align: middle; }

/* епілог */
.card--epilogue-story, .card--epilogue-item {
  background: var(--noise),
    radial-gradient(circle at 8px 8px, #c8d07a 2px, transparent 3px) 0 0/22px 22px,
    linear-gradient(180deg, #2e302a, #3e4436 50%, #2e302a);
}
.card--epilogue-story .tx-body, .card--epilogue-item .tx-body {
  left: 26px; right: 26px; top: 26px; bottom: 34px; padding: 14px 14px;
  border: 6px solid #a8b45a; border-radius: 14px;
  box-shadow: 0 0 0 3px #3a3e2a, inset 0 0 14px rgba(90,70,120,.35);
  background: var(--noise), radial-gradient(ellipse at 50% 45%, #f1ecf6 0%, #ddd2e6 70%, #bfb0cc 100%);
}
.card--epilogue-story .tx-body { text-align: center; font: 500 14px/1.24 'Alegreya Sans', sans-serif; }
.card--epilogue-item .tx-body { font: 500 14px/1.24 'Alegreya Sans', sans-serif; }
.ep-banner {
  text-align: center; font: 27px/1 'Rye', serif; text-transform: uppercase; margin-bottom: .45em;
  background: linear-gradient(180deg, #e8c8f4, #8a4ab4 50%, #3a1250);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 #1a0a20);
}
.ep-title { text-align: center; font: 26px 'Marcellus SC', serif; color: #3a2440; margin-bottom: .2em; }
.card--epilogue-story .tx-foot, .card--epilogue-item .tx-foot { color: #e8e8d4; text-shadow: 0 1px 2px #000; bottom: 10px; }
.card--epilogue-item .die > div b { font-family: 'Alegreya', serif; }

/* ілюстрації з multiply-змішуванням */
.art { display: block; margin: 0 auto; background-size: contain; background-repeat: no-repeat; background-position: center; }
.card--epilogue-item .art { width: 92%; height: 128px; margin-bottom: .4em; }

/* ========== LOOT / TROVE ========== */
.card--loot, .card--trove { padding: 0; }
.card--loot {
  background: var(--noise),
    radial-gradient(ellipse at 50% 40%, rgba(255,240,180,.55), transparent 65%),
    radial-gradient(ellipse at 50% 50%, #e9b94a 0%, #d79a2e 60%, #9a6414 100%);
}
.card--trove {
  background: var(--noise),
    radial-gradient(ellipse at 50% 40%, rgba(255,200,120,.5), transparent 60%),
    radial-gradient(ellipse at 50% 50%, #e0813a 0%, #c0521e 55%, #6e1e0c 100%);
}
.lt-inner { position: absolute; inset: 14px 18px 14px; display: flex; flex-direction: column; }
.lt-title { text-align: center; font: 2.1em/0.98 'Marcellus SC', serif; color: #2a1608; margin-top: 4px; }
.card--trove .lt-title { color: #f6d6a0; text-shadow: 0 0 2px #3a0e04, 0 2px 0 #3a0e04, 0 0 6px rgba(0,0,0,.6); }
.set-rage.card--loot .lt-title { font-family: 'Rye', serif; font-size: 30px; color: #a3171b; text-transform: none; }
.lt-sub { text-align: center; font: 700 .72em 'Alegreya Sans', sans-serif; margin: 3px 0 2px; }
.lt-inner.fit { font-size: 16px; }
.lt-art { flex: 1 1 0; min-height: 70px; margin: 4px 0; }
.lt-text { flex: 0 0 auto; font: 500 1em/1.22 'Alegreya Sans', sans-serif; }
.card--trove .lt-text b { font-weight: 700; }
.lt-corner-tl { position: absolute; left: 10px; top: 10px; }
.lt-corner-tl .ic { --s: 16px; }
.lt-corner-tr { position: absolute; right: 10px; top: 8px; }
.lt-corner-tr .ic { --s: 34px; }
