/* The open file is shared by every dossier, including search, halls and profile.
   The photographic plate contains no data; all labels and controls are HTML. */
.case-file {
    --kill: #f12924;
    --kill-dark: #790c09;
    --kill-rgb: 241 41 36;
    --love: #a0d4ac;
    --love-dark: #355c40;
    --love-rgb: 160 212 172;
    --text: #d4cfc5;
    --muted: #aaa69c;
    --line: #50453b;
    --line-strong: #76604f;
    isolation: isolate;
    gap: 12px;
    min-width: 0;
    min-height: 660px;
    padding: 48px 26px 35px;
    border: 0;
    border-radius: 3px;
    background: #0a0909 url('../images/dossier-open-v2.webp') center / 100% 100% no-repeat;
    color: var(--text);
    font: 12px/1.4 var(--mono);
    box-shadow: 3px 9px 20px #000b;
}
.case-file:hover { transform: none; }
.case-file::after { display: none; }
.case-file.card--killed { filter: none; }
.case-file .card__rank {
    top: 26px; right: 24px; font-size: 30px; transform: rotate(12deg);
    color: #b11c1599; -webkit-text-stroke: 0; opacity: .65;
    mask-image: url('../images/dossier-ink.svg'); mask-size: 100% 100%;
}
.case-file .card__head { gap: 18px; align-items: center; min-height: 122px; padding-bottom: 5px; }
.case-file .card__portrait {
    position: relative; width: 36%; max-width: 110px; padding: 4px;
    background: #60564d; border: 1px solid #807163; transform: rotate(-2deg);
    box-shadow: 2px 4px 5px #000a;
}
.case-file .card__portrait .avatar {
    display: block; width: 100%; height: auto; aspect-ratio: 4 / 5;
    border: 0; border-radius: 0; object-fit: cover;
    filter: saturate(.6) contrast(1.13) brightness(.85);
}
.case-file .card__portrait .avatar--emoji { display: grid; place-items: center; font-size: 48px; background: #211c19; }
.case-file .card__portrait::before {
    content: ''; position: absolute; z-index: 2; top: -12px; left: 17%; width: 67%; height: 22px;
    background: linear-gradient(10deg, #b6a58c45, #a99c8940 60%, #d8c4a657);
    border: 1px solid #c6b59a23; transform: rotate(8deg);
    clip-path: polygon(2% 0, 100% 4%, 97% 48%, 100% 100%, 0 95%, 3% 57%);
    pointer-events: none;
}
.case-file .card__portrait::after {
    content: ''; position: absolute; inset: 3px; pointer-events: none;
    background: linear-gradient(88deg, transparent 47%, #d9c4a949 48%, #120c0ab0 49%, transparent 50%),
        linear-gradient(2deg, transparent 28%, #b9b09d99 28.5%, #0009 29.4%, transparent 30.5%),
        linear-gradient(-3deg, transparent 72%, #dbd5ba66 72.5%, transparent 73.5%);
    box-shadow: inset 0 0 13px #10040388;
}
.case-file .card__ident { flex: 1; }
.case-file .card__name { font: bold 20px/1.12 Georgia, serif; overflow-wrap: anywhere; text-shadow: 1px 1px 2px #000; }
.case-file .card__handle { margin: 3px 0 9px; font-size: 12px; overflow-wrap: anywhere; }
.case-file .badges { gap: 5px; margin: 0; }
.case-file .badge {
    padding: 2px 4px; border: 1px solid #665f5488; border-radius: 0;
    background: #07080766; color: #bcb6a9; font: 10px/1.25 var(--mono); letter-spacing: -.035em;
    box-shadow: inset 0 0 3px #c1ad8630, 1px 1px 2px #000;
}
.case-file .badge--gold { color: #ff3028; border-color: #b7271d; background: #600b0755; box-shadow: 0 0 8px #ee180f33; }
.case-file .badge--saved { color: var(--love); border-color: var(--love-dark); }
.case-file .badge--killed { color: var(--kill); border-color: var(--kill-dark); }
.case-file .card__reason {
    display: block; overflow: visible; margin: 0; font-size: 12px; line-height: 1.5;
    padding-top: 9px; border-top: 1px solid #79665355; overflow-wrap: anywhere;
}
.case-file > .muted { margin: -6px 0 0; font-size: 10px; }
.case-file .card__execution {
    font: 800 17px/1.4 var(--mono); color: var(--kill); overflow-wrap: anywhere;
    padding: 8px 0;
    text-shadow: 0 0 6px #db160955;
}
.case-file .race { gap: 12px; border-top: 1px solid #79665366; padding-top: 12px; margin-top: 1px; }
.case-file .race__row { position: relative; grid-template-columns: auto minmax(0, 1fr); gap: 5px 9px; padding-left: 42px; font-size: 11px; }
.case-file .race__side { grid-column: 1; grid-row: 1; font-size: 11px; letter-spacing: 0; align-self: center; }
.case-file .race__icon {
    position: absolute; left: 0; top: -2px; font-size: 28px; line-height: 1.2;
    filter: sepia(.5) saturate(.7); text-shadow: 0 0 8px #dd352677;
}
.case-file .is-love .race__icon { text-shadow: 0 0 9px #75e99777; }
.case-file .race__amount { grid-column: 2; grid-row: 1; white-space: normal; text-align: right; font-size: 11px; line-height: 1.35; }
.case-file .race__amount strong { white-space: nowrap; }
.case-file .race__amount small { font-size: 10px; }
.case-file .race__row:first-child .race__amount strong { color: var(--kill); font-size: 20px; text-shadow: 0 0 6px #db160955; }
.case-file .meter__bar { grid-column: 1 / -1; grid-row: 2; width: 100%; height: 13px; border: 1px solid #78665888; border-radius: 0; background: #0008; box-shadow: inset 0 0 4px #000, 0 1px #b6a58a22; }
.case-file .meter__fill { animation: none; background-image: linear-gradient(90deg, #710a09, #d22720); box-shadow: 0 0 6px #f33525; }
.case-file .meter__fill--love { background-image: linear-gradient(90deg, #2d4933, #95caa1); box-shadow: 0 0 6px #8cd6a0; }
.case-file--large-amounts .race__amount { grid-column: 1 / -1; grid-row: 2; text-align: left; }
.case-file--large-amounts .race__row:first-child .race__amount strong { font-size: 17px; }
.case-file--large-amounts .meter__bar { grid-row: 3; }
.case-file .race__foot { display: grid; gap: 10px; margin: 0; padding-top: 9px; border-color: #79665366; font-size: 11px; line-height: 1.5; }
.case-file .race__foot > span + span { border-top: 1px solid #79665344; padding: 10px 0 0 35px; min-height: 37px; }
.case-file .card__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; width: 76%; font-size: 13px; }
.case-file .card__stats > div { min-width: 0; padding: 5px 8px; border: 1px solid #79665366; box-shadow: inset 0 0 4px #000; background: #0004; }
.case-file .card__stats > div:last-child { grid-column: 1 / -1; }
.case-file .card__stats span:first-child { font-size: 10px; letter-spacing: 0; }
.case-file .card__stats span + span { font-weight: bold; }
.case-file .card__actions { gap: 9px; padding-top: 4px; }
.case-file .card__actions .btn {
    position: relative; min-width: 0; min-height: 65px; padding: 10px 5px;
    border: 1px solid #d32b21; border-radius: 2px; color: #f4b7a5;
    background: linear-gradient(125deg, #b31614bc, #5d0908c9), url('../images/dossier-open-v2.webp') 30% 90% / 220% auto;
    box-shadow: inset 0 0 10px #0007, 0 2px 4px #000; font: 28px/1.1 'Arial Narrow', Impact, var(--mono); letter-spacing: -.04em;
    text-shadow: 0 0 5px #eb5c43aa;
}
.case-file .card__actions .btn--love { border-color: #72987999; color: #b3d4b6; background: linear-gradient(125deg, #1c3b29a8, #17261dd9), url('../images/dossier-open-v2.webp') 70% 85% / 220% auto; text-shadow: 0 0 7px #85dda277; }
.case-file .card__actions .btn--ghost { font: bold 14px/1.4 var(--mono); letter-spacing: 0; border-color: #8c7967; background: #0c0b09aa; }
.case-file .card__actions .btn:hover { filter: brightness(1.22); transform: translateY(-1px); }
.case-file .stamp { z-index: 3; top: 135px; max-width: 88%; }
/* Dry, broken ink on display lettering; small body text and sums stay intact. */
.case-file .card__name,
.case-file .badge,
.case-file .race__side > span:last-child,
.case-file .card__execution,
.case-file .card__stats span:first-child,
.case-file .card__action-label,
.case-file .stamp {
    mask-image: url('../images/dossier-type-wear.svg');
    mask-size: 180px 72px;
    mask-repeat: repeat;
}
.case-file .card__name { text-shadow: .6px .4px #efe1c138, -1px 0 #130a07; }
.case-file .badge:nth-child(2n) { mask-position: -47px -21px; }
.case-file .stamp { mask-size: 240px 96px; border-radius: 3px; }
.case-file .card__stats > div {
    border-color: #79665380 #463a3070 #58463799 #74614e88;
    background: linear-gradient(174deg, transparent 43%, #aa8c6433 43.3%, #0008 43.7%, transparent 44.3%), #0004;
}
.case-file .card__actions .btn::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: url('../images/dossier-scuffs.svg') center / 100% 350%; opacity: .6;
    box-shadow: inset 1px 1px #e2b89b44, inset -2px -2px #0007;
}
.case-file .card__action-label { position: relative; z-index: 1; }
.case-file .card__portrait { border-color: #b1a18b88 #564635 #b1a18b99 #46392c; }
.dossier__cover::after {
    content: ''; position: absolute; z-index: 4; inset: 0; pointer-events: none;
    background: url('../images/dossier-scuffs.svg') center / 100% 100%;
    /* Keep scuffs inside the photographic folder's irregular silhouette. */
    mask-image: url('../images/dossier-folder-v2.webp'); mask-size: 100% 100%;
}
.dossier__label {
    background: linear-gradient(105deg, #ae96755e, #dac7a18c 34%, #c5ac8159 70%, #6c52334d),
        url('../images/dossier-folder-v2.webp') 40% 70% / 350% 350%;
    box-shadow: inset 0 0 9px #4b321a77;
    clip-path: polygon(1% 2%, 13% 0, 14% 3%, 33% 1%, 52% 2%, 76% 0, 97% 2%, 100% 15%, 98% 39%, 100% 54%, 98% 82%, 100% 95%, 87% 99%, 71% 97%, 49% 100%, 28% 98%, 10% 100%, 0 96%, 2% 74%, 0 58%, 2% 38%, 0 16%);
}
.dossier__name,
.dossier__handle,
.dossier__tags > span,
.dossier__toggle > span {
    mask-image: url('../images/dossier-type-wear.svg');
    mask-size: 200px 80px; mask-repeat: repeat;
}
.dossier__tags > span { background: #85704a18; border-color: #59432d; }
.dossier__tags > span:nth-child(2n) { mask-position: -63px -25px; }
.dossier__portrait { border: 1px solid #54422d66; box-shadow: 1px 3px 4px #271709bb, inset 0 0 7px #4e38267a; }
@container (max-width: 290px) {
    .case-file { padding: 40px 19px 28px; min-height: 620px; gap: 10px; }
    .case-file .card__head { gap: 11px; min-height: 105px; }
    .case-file .card__name { font-size: 17px; }
    .case-file .card__handle { font-size: 10px; }
    .case-file .badge { font-size: 9px; }
    .case-file .race__row { padding-left: 30px; gap: 5px; }
    .case-file .race__icon { font-size: 23px; }
    .case-file .race__side { font-size: 10px; }
    .case-file .race__row:first-child .race__amount strong { font-size: 17px; }
    .case-file .card__stats { width: 90%; }
    .case-file .card__actions .btn { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) { .case-file .card__actions .btn:hover { transform: none; } }

/* Full dossier: the same paper, ink and portrait treatment as the compact file.
   Keep the wider reading layout and all sharing/payment controls available. */
.case-file--detail {
    padding: 48px 32px 38px;
    min-height: 0;
    background-size: 100% 100%;
    font-size: 13px;
    line-height: 1.6;
}
.case-file--detail > * + * { margin-top: 20px; }
.case-file--detail .detail__status {
    padding: 12px 15px; margin-bottom: 24px;
    border: 1px solid #79665366; border-radius: 0;
    background: #07080766; box-shadow: inset 0 0 9px #0006;
}
.case-file--detail .detail__status--saved { border-color: var(--love-dark); }
.case-file--detail .detail__status--killed { border-color: var(--kill-dark); }
.case-file--detail .detail__id { gap: 24px; align-items: center; }
.case-file--detail .detail__id > :last-child { flex: 1; min-width: 0; }
.case-file--detail .detail__portrait { width: 150px; max-width: 100%; }
.case-file--detail .detail__portrait > .avatar {
    display: block; padding: 5px; border: 1px solid #b1a18b88;
    background: #60564d; transform: rotate(-2deg); box-shadow: 2px 4px 5px #000a;
}
.case-file--detail .detail__portrait .avatar {
    width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
    border-radius: 0; filter: saturate(.6) contrast(1.13) brightness(.85);
}
.case-file--detail .detail__portrait .avatar--emoji { display: grid; place-items: center; font-size: 60px; }
.case-file--detail .detail__portrait::before {
    content: ''; position: absolute; z-index: 2; top: -9px; left: 17%; width: 67%; height: 22px;
    background: linear-gradient(10deg, #b6a58c45, #a99c8940 60%, #d8c4a657);
    border: 1px solid #c6b59a23; transform: rotate(6deg); pointer-events: none;
    clip-path: polygon(2% 0, 100% 4%, 97% 48%, 100% 100%, 0 95%, 3% 57%);
}
.case-file--detail .detail__name {
    font: bold clamp(24px, 3.5vw, 38px)/1.12 Georgia, serif;
    overflow-wrap: anywhere; text-shadow: .6px .4px #efe1c138, -1px 0 #130a07;
}
.case-file--detail .detail__handle { margin: 5px 0 12px; overflow-wrap: anywhere; }
.case-file--detail .detail__reason {
    padding: 16px 0; border: 0; border-top: 1px solid #79665366;
    border-bottom: 1px solid #79665366; border-radius: 0; background: transparent;
    font-size: 14px; overflow-wrap: anywhere;
}
.case-file--detail .card__execution { font-size: 21px; padding: 12px 0; }
.case-file--detail .linkchip {
    max-width: 100%; border-radius: 0; border-color: #665f5488; background: #07080766;
    padding: 5px 8px; font-size: 11px; overflow-wrap: anywhere;
}
.case-file--detail .linkchip__url { min-width: 0; overflow-wrap: anywhere; }
.case-file--detail .race { margin-top: 20px; }
.case-file--detail .race__row { padding-left: 40px; }
.case-file--detail .race__amount { font-size: 13px; }
.case-file--detail .race__row:first-child .race__amount strong { font-size: 24px; }
.case-file--detail .meter__bar { height: 15px; }
.case-file--detail .race__foot > span + span { padding-left: 0; }
.case-file--detail .sharebox {
    padding: 16px; border: 1px solid #79665366; border-radius: 0;
    background: #0004; box-shadow: inset 0 0 9px #0006;
}
.case-file--detail .sharebox .btn {
    border-radius: 2px; border-color: #8c7967;
    color: #d4c3a6; background: linear-gradient(125deg, #4c3e2cbb, #1b1712dd);
    box-shadow: inset 0 0 10px #0007, 0 2px 4px #000;
}
.case-file--detail .sharelink { white-space: pre-wrap; overflow-wrap: anywhere; background: #0005; }
.case-file--detail .detail__name,
.case-file--detail .detail__statuslabel,
.case-file--detail .detail__reason > strong,
.case-file--detail .sharebox__title {
    mask-image: url('../images/dossier-type-wear.svg');
    mask-size: 180px 72px; mask-repeat: repeat;
}
.case-file--detail .stamp { position: static; display: inline-block; max-width: 100%; }
.case-file--detail .stamp--big { font-size: clamp(18px, 3vw, 36px); letter-spacing: .08em; }
.case-file--detail .stamp--onphoto { position: absolute; top: 50%; left: 50%; font-size: 12px; }
@media (max-width: 540px) {
    .case-file--detail { padding: 36px 20px 28px; }
    .case-file--detail .detail__id { align-items: flex-start; gap: 20px; }
    .case-file--detail .detail__portrait { width: 125px; }
    .case-file--detail .detail__name { font-size: 26px; }
    .case-file--detail .detail__status { padding: 10px; }
    .case-file--detail .race__row { padding-left: 32px; }
    .case-file--detail .race__amount { grid-column: 1 / -1; grid-row: 2; text-align: left; }
    .case-file--detail .meter__bar { grid-row: 3; }
    .case-file--detail .sharebox { padding: 12px; }
}
