/* One card size and one safe parchment area, on every card surface. */
:root{--card-face-width:216px;--card-face-height:228px}
body .card:has(>.card-frame){
 position:relative!important;isolation:isolate;display:block!important;
 box-sizing:border-box!important;width:var(--card-face-width)!important;min-width:var(--card-face-width)!important;max-width:var(--card-face-width)!important;
 height:var(--card-face-height)!important;min-height:var(--card-face-height)!important;max-height:var(--card-face-height)!important;
 flex:0 0 var(--card-face-width)!important;aspect-ratio:288/304;margin:0;
 padding:0!important;border:0!important;border-radius:14px!important;overflow:hidden!important;
 background:transparent!important;color:#30291e!important;text-align:left!important;box-shadow:0 3px 9px #0005!important;
 --card-text-scale:1;
}
body .card:has(>.card-frame)::before,body .card:has(>.card-frame)::after{display:none!important}
body .card:has(>.card-frame)>.card-frame{position:absolute;inset:0;display:block;z-index:-1;pointer-events:none}
.card-frame>img{display:block;width:100%;height:100%;object-fit:fill;user-select:none}
/* Crop the source sheets' thin black gutter; round the clipping to the frame. */
body .card:has(>.card-frame)>.card-frame{border-radius:inherit;overflow:hidden}
body .card:has(>.card-frame)>.card-frame>img{position:absolute;left:-1.5px;top:-1.5px;width:calc(100% + 3px);height:calc(100% + 3px)}
body .card:has(>.card-frame)>.card-body{
 position:absolute!important;left:13.5%!important;right:13.5%!important;top:22%!important;bottom:27%;
 display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;
 min-width:0!important;min-height:0!important;width:auto!important;height:auto!important;max-height:none!important;
 padding:0!important;margin:0!important;gap:0!important;overflow:hidden!important;
 font:calc(12px * var(--card-text-scale))/1.3 system-ui,-apple-system,Segoe UI,sans-serif!important;
 overflow-wrap:anywhere;white-space:normal!important;text-shadow:none!important;color:#30291e!important;
}
body .card:has(>.card-frame)>.card-body>strong{
 display:block!important;flex:none!important;font:700 calc(16px * var(--card-text-scale))/1.12 Georgia,serif!important;
 margin:0 0 calc(7px * var(--card-text-scale))!important;padding:0!important;color:#30291e!important;letter-spacing:0!important;
}
body .card:has(>.card-frame) .description{
 display:block!important;flex:none!important;min-height:0!important;margin:0!important;padding:0!important;
 font:inherit!important;line-height:inherit!important;color:#413626!important;white-space:normal!important;
}
body .card:has(>.card-frame) .description strong,body .card:has(>.card-frame) .card-emphasis{
 display:inline!important;font:inherit!important;font-weight:800!important;line-height:inherit!important;margin:0!important;letter-spacing:0!important;
}
body .card:has(>.card-frame) .kind{display:none!important}
body .card:has(>.card-frame)>.cost{
 position:absolute!important;left:13.5%!important;right:13.5%!important;bottom:11.5%!important;width:auto!important;
 margin:0!important;padding:0!important;border:0!important;display:block!important;
 font:750 calc(12px * var(--card-text-scale))/1.25 system-ui,-apple-system,Segoe UI,sans-serif!important;
 color:#aa2820!important;white-space:normal!important;overflow-wrap:anywhere;
}
body .card:has(>.card-frame) .card-cost-item{display:inline!important;white-space:normal!important}
body .card:has(>.card-frame)>.card-upgrade-line{
 position:absolute;top:9.5%;left:13.5%;right:13.5%;height:25px;display:flex;align-items:center;pointer-events:none;
}
body .card:has(>.card-frame) .card-upgrade-star{position:relative!important;inset:auto!important;margin:0!important;width:22px;height:22px;pointer-events:auto}
body .card:has(>.card-frame) .new-badge{
 position:absolute!important;top:10.5%!important;left:auto!important;right:13.5%!important;margin:0!important;
 z-index:3;font-size:9px!important;line-height:1.4!important;padding:2px 5px!important;white-space:nowrap;
}
body .card:has(>.card-frame) .card-body>.technology,body .card:has(>.card-frame) .upgrade-bonus{
 flex:none!important;font-size:inherit!important;line-height:inherit!important;white-space:normal!important;
}
body .card:has(>.card-frame) .card-upgrade-gain{font-size:inherit!important;line-height:inherit!important;margin-top:1px!important}
body .card:has(>.card-frame) .resource-icon{width:1.35em!important;height:1.35em!important;vertical-align:middle!important;flex:none}
body .card:has(>.card-frame) .card-adjusted,body .card:has(>.card-frame) .card-upgrade-gain,body .card:has(>.card-frame) .upgrade-bonus{color:#228136!important}
body .card:has(>.card-frame).chosen,body .card:has(>.card-frame).choice-selected{outline:2px solid #ffe16c!important;outline-offset:2px;box-shadow:0 0 13px #ffdf6d88!important}
body .card:has(>.card-frame).already-played{filter:grayscale(1)!important;opacity:.42!important}
body .card:has(>.card-frame) .reserve-card-actions{position:absolute;z-index:5;left:14%;right:14%;top:43%;padding:0;border:0;opacity:0;pointer-events:none}
body .card:has(>.card-frame):hover .reserve-card-actions,body .card:has(>.card-frame):focus-within .reserve-card-actions{opacity:1;pointer-events:auto}
@media(hover:none){body .card:has(>.card-frame) .reserve-card-actions{opacity:1;pointer-events:auto}}
body .card:has(>.card-frame) .reserve-card-actions button{width:100%;font-size:12px;padding:8px}
body .mystery-card:has(>.card-frame) .mystery-symbol{position:absolute;top:7%;left:0;right:0;text-align:center;font:bold 32px/1 Georgia,serif;color:#856328}
body .mystery-card:has(>.card-frame)>.card-body{top:30%!important;text-align:center}
/* Keep the hand hover hitbox stationary while the card rises. */
.game-mode .hand-card-slot{width:var(--card-face-width)!important;min-width:var(--card-face-width)!important;max-width:var(--card-face-width)!important;flex:0 0 var(--card-face-width)!important;height:var(--card-face-height)}
body .choice-card-slot{width:var(--card-face-width)!important;min-width:var(--card-face-width)!important;max-width:var(--card-face-width)!important;justify-self:center}
body .choice-grid{grid-template-columns:repeat(3,var(--card-face-width));justify-content:center;gap:18px}
body .choice-grid.reward-four{grid-template-columns:repeat(4,var(--card-face-width))}
body .class-cards-dialog .cards,body #classCardsContent{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-start;justify-content:center}
body #classCardsContent:has(.starter-deck-preview){display:block}
body .starter-deck-preview .cards{justify-content:flex-start}
body .starter-deck-preview{overflow:visible}
body .cards:has(>.card-frame),body .cards:has(>.card:has(>.card-frame)){align-items:flex-start}
body .discard-cards,body .equipped-cards{align-items:flex-start}
body .hand-card-preview,body #consumableTooltip{width:var(--card-face-width)!important}
body .selected-action-card{overflow:visible}
body.game-mode .selected-action-card .card{margin-left:auto!important;margin-right:auto!important}
body.game-mode .board-area>.selected-tile-preview:has(.selected-action-card){width:238px;max-width:238px}
body .card-choice{min-width:760px;width:max-content;max-width:96%;overflow:auto}
body .card-choice:has(.reward-four){min-width:980px}
body .class-cards-dialog .cards .card{flex:0 0 var(--card-face-width)!important}

/* 0.9.85 — retain upgrade tier colors after the choice. */
body .card:has(>.card-frame) .card-upgrade-gain.upgrade-gain-legendary,
body .card:has(>.card-frame) .upgrade-bonus.upgrade-rarity-legendary{color:#926000!important}
body .card:has(>.card-frame) .card-upgrade-gain.upgrade-gain-epic,
body .card:has(>.card-frame) .upgrade-bonus.upgrade-rarity-epic{color:#7438b2!important}
body .card:has(>.card-frame)>.card-body>strong,
body .card:has(>.card-frame)>.cost{text-align:center!important}
/* Eight one-pixel shadows outline each glyph without covering its fill. */
body .card:has(>.card-frame) .card-body,
body .card:has(>.card-frame) .card-body *,
body .card:has(>.card-frame) .cost,
body .card:has(>.card-frame) .cost *,
body .card:has(>.card-frame) .new-badge,
body .card:has(>.card-frame) .upgrade-star-level,
body .card:has(>.card-frame) .mystery-symbol{
 text-shadow:-1px -1px 0 #fff,0 -1px 0 #fff,1px -1px 0 #fff,-1px 0 0 #fff,1px 0 0 #fff,-1px 1px 0 #fff,0 1px 0 #fff,1px 1px 0 #fff!important;
}

/* 0.9.86 — rarity on the star line and an exterior glow, without resizing. */
body .card:has(>.card-frame){--card-rarity-color:#8a8a82;--card-rarity-glow:#bcbcb488}
body .card:has(>.card-frame):has(.card-rarity[data-rarity=rare]){--card-rarity-color:#469eff;--card-rarity-glow:#469eff99}
body .card:has(>.card-frame):has(.card-rarity[data-rarity=epic]){--card-rarity-color:#b472ff;--card-rarity-glow:#b472ff99}
body .card:has(>.card-frame):has(.card-rarity[data-rarity=legendary]){--card-rarity-color:#ffd568;--card-rarity-glow:#ffd568aa}
body .card:has(>.card-frame):has(>.card-upgrade-line>.card-rarity){
 box-shadow:0 0 0 2px var(--card-rarity-color),0 0 16px var(--card-rarity-glow),0 3px 9px #0005!important;
}
body .card:has(>.card-frame) .card-rarity{
 position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);text-align:center;
 font:800 10px/1.2 system-ui,-apple-system,Segoe UI,sans-serif;letter-spacing:.2px;
 color:var(--card-rarity-color);white-space:nowrap;pointer-events:none;
 text-shadow:-1px -1px 0 #fff,0 -1px 0 #fff,1px -1px 0 #fff,-1px 0 0 #fff,1px 0 0 #fff,-1px 1px 0 #fff,0 1px 0 #fff,1px 1px 0 #fff;
}
body .card:has(>.card-frame)>.new-badge{font-size:7.5px!important;padding:2px 3px!important}
/* The mystery symbol stays separate from its rarity label. */
body .mystery-card:has(>.card-frame) .mystery-symbol{top:23%;font-size:28px}
body .mystery-card:has(>.card-frame)>.card-body{top:40%!important}
body .card:has(>.card-frame) .upgrade-star-level{color:#000!important}
/* 0.9.88 — thin white silhouette behind the animated gold star. */
body .card:has(>.card-frame) .card-upgrade-star::before{
 content:'';position:absolute;inset:-1px;background:#fff;pointer-events:none;
 clip-path:polygon(50% 0,62% 34%,98% 35%,70% 58%,80% 96%,50% 74%,20% 96%,30% 58%,2% 35%,38% 34%);
}
body .hand-card-preview{transform:translate(-50%,-50%) scale(1.5);transform-origin:center;pointer-events:none}

/* 0.9.93 — one bounded canvas replaces the individual animated DOM sparks. */
body .card:has(>.card-frame)>.rarity-particles{
 position:absolute;inset:0;display:block;width:100%;height:100%;z-index:2;
 overflow:hidden;border-radius:inherit;pointer-events:none;user-select:none;contain:strict;
}
@media(prefers-reduced-motion:reduce){body .card:has(>.card-frame)>.rarity-particles{display:none}}
