/* Blackgate rarity: coloured paper, engraved fittings and a maker's seal. */
.rarity-common,.quality-common{--rarity-paper:#eeeee7;--rarity-deep:#59645b;--rarity-edge:#9aa397;--rarity-metal:#7b8275;--rarity-wash:#dce0d6}
.rarity-uncommon,.quality-uncommon{--rarity-paper:#e0ecd9;--rarity-deep:#285e35;--rarity-edge:#6e9860;--rarity-metal:#8a7947;--rarity-wash:#b9d0ab}
.rarity-rare,.quality-rare{--rarity-paper:#dfebf2;--rarity-deep:#294d74;--rarity-edge:#7296b5;--rarity-metal:#7e94a3;--rarity-wash:#b8cfdf}
.rarity-epic,.quality-epic{--rarity-paper:#eae0f0;--rarity-deep:#613a76;--rarity-edge:#a184b7;--rarity-metal:#9285a0;--rarity-wash:#d0badd}
.rarity-legendary,.quality-legendary{--rarity-paper:#f5ead0;--rarity-deep:#79531b;--rarity-edge:#b38c40;--rarity-metal:#b38c40;--rarity-wash:#e6cf97}
:is(.item-card,.inventory-stack,.inventory-row,.reward-tile,.equipment-project,.npc-sell-card,.npc-shop-item,.stack-card,.shop-card,.project-goal-grid>.paper)[class*="rarity-"],:is(.inventory-stack,.reward-tile)[class*="quality-"]{position:relative;isolation:isolate;background:linear-gradient(135deg,var(--rarity-wash) 0%,var(--rarity-paper) 35%,var(--rarity-paper) 80%,var(--rarity-wash));border:1px solid var(--rarity-edge);border-top:3px solid var(--rarity-deep);box-shadow:inset 0 0 0 3px #ffffff38,0 2px 5px #182b2010;color:#24362c}
:is(.item-card,.inventory-stack,.reward-tile,.equipment-project)[class*="rarity-"],:is(.inventory-stack,.reward-tile)[class*="quality-"]{background-image:linear-gradient(45deg,transparent 97%,var(--rarity-metal) 97%),linear-gradient(-45deg,transparent 97%,var(--rarity-metal) 97%),linear-gradient(135deg,var(--rarity-wash),var(--rarity-paper) 45%,var(--rarity-paper) 80%,var(--rarity-wash))}
:is(.item-card,.inventory-stack,.reward-tile,.equipment-project):is(.rarity-rare,.rarity-epic,.rarity-legendary,.quality-rare,.quality-epic,.quality-legendary)::after{content:"";position:absolute;right:12px;top:13px;width:17px;height:21px;background:var(--rarity-deep);mask:url('/assets/port-v18/crest.svg') center/contain no-repeat;opacity:.55;pointer-events:none;z-index:-1}
:is(.item-card,.inventory-stack,.reward-tile,.equipment-project):is(.rarity-epic,.rarity-legendary,.quality-epic,.quality-legendary){outline:1px solid var(--rarity-metal);outline-offset:-6px}
:is(.item-card,.inventory-stack,.reward-tile,.equipment-project) .item-art{border:2px solid var(--rarity-metal,#6a735d);box-shadow:0 2px 5px #13241924}
.item-card .item-title,.inventory-stack h3,.equipment-project h3{color:var(--rarity-deep,#243f36)}
.inventory-row[class*="rarity-"]{border-left:5px solid var(--rarity-deep)}
.rarity-label{font-weight:650}
.weapon-combat h2{font-size:29px}.combat-readiness{display:flex;flex-wrap:wrap;gap:24px;padding:13px 0;border-bottom:1px solid #b7bea5;margin-bottom:15px}.combat-readiness>span{display:flex;align-items:center;gap:8px}.combat-readiness i{width:14px;height:14px;border:1px solid #8c7b4c;background:#e6e1cc;transform:rotate(45deg)}.combat-readiness i.filled{background:#b3964c;box-shadow:inset 0 0 0 2px #f8efc4}.combat-readiness b{font-size:13px;color:#53634a}
.ability-section{margin:20px 0}.ability-section h3{font-family:'Source Sans 3',sans-serif;font-size:16px;margin:0 0 9px}.weapon-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.weapon-actions.class{grid-template-columns:repeat(2,minmax(0,1fr))}.weapon-actions.utility{grid-template-columns:minmax(0,1fr)}.ability-choice{display:grid;grid-template-columns:1fr 28px;gap:7px;align-content:start;padding:10px;background:#f1f0e4;border:1px solid #c7cbb8;border-radius:3px}.ability-choice .button{grid-column:1/-1;white-space:normal;min-height:45px;font-size:15px;padding:9px}.ability-choice small{font-size:13px;line-height:1.45;grid-column:1/-1;color:#4d5c45}.ability-mark{grid-column:2;grid-row:2;display:none}.weapon-actions.utility .ability-mark{display:block;grid-column:1;grid-row:auto}.weapon-actions.utility .ability-mark .item-art{width:42px;height:42px}.ability-cost{font-size:12px;color:#6e5d31}.combat-status{display:inline-block;font-size:12px;border:1px solid #a6ad92;border-radius:3px;padding:2px 5px;margin:5px 4px 0 0;background:#e4e9dc}.status-burn{background:#f0dfcc;color:#82421c}.status-bleed{background:#efd9d3;color:#813f36}
.combat-loadout,.advanced-talents,.practice-ring,.skill-journal,.enemy-journal{padding:22px;margin-top:18px}.combat-loadout form{display:grid;gap:15px}.loadout-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.loadout-fields label{min-width:0}.loadout-fields select{width:100%;max-width:100%}.utility-preview{display:flex;align-items:center;gap:12px}.talent-tier{padding:12px 0;border-top:1px solid #c4c9b3}.practice-ring>.row{gap:9px}.practice-ring .tactical-panel{box-shadow:none;border:none;padding:0}.school-requirement{font-size:14px!important;font-weight:600;color:#5f603d!important}.school-card .meter{margin:12px 0}.school-card small{line-height:1.7}
.equipment-project{padding:26px}.project-art{float:right;margin:0 0 15px 20px}.project-art .item-art{width:130px;height:130px}.project-checks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;clear:both;padding:12px 0 18px}.project-checks>div{font-size:14px;display:grid;grid-template-columns:1fr auto;gap:5px}.project-checks .meter{grid-column:1/-1;height:5px}.project-goal-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.project-goal-grid>.paper{padding:18px}.project-goal-grid h3{font-size:23px;margin:10px 0}.project-goals{margin-bottom:20px}.skill-journal-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.enemy-journal>div{padding:14px 0;border-bottom:1px solid #c7cbb7}.enemy-journal p{margin:5px 0}.burn-event::after{content:"";position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 -35px 45px #b4552340;animation:combat-flare .5s ease-out}.bleed-event .scene-fighter.enemy{animation:combat-flare .3s ease-out}@keyframes combat-flare{from{filter:brightness(1.4)}to{filter:brightness(1)}}
.reward-tile.quality-rare,.reward-tile.quality-epic,.reward-tile.quality-legendary{animation:earned-item .45s ease-out both;animation-delay:var(--reveal-delay,0ms)}@keyframes earned-item{from{opacity:.3;transform:translateY(10px) scale(.97)}to{opacity:1;transform:none}}
@media(max-width:760px){.weapon-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.loadout-fields,.project-checks,.project-goal-grid{grid-template-columns:1fr}.ability-choice .button{min-height:48px}.equipment-project{padding:18px}.project-art .item-art{width:92px;height:92px}.combat-loadout,.advanced-talents,.practice-ring{padding:18px}.skill-journal-grid{grid-template-columns:1fr}.weapon-combat h2{font-size:26px}.workspace-tabs{overflow-x:auto}}
@media(prefers-reduced-motion:reduce){.reward-tile,.burn-event::after,.bleed-event .scene-fighter.enemy{animation:none!important}}

.weapon-combat .combat-scene{height:clamp(180px,25vh,240px)}
