/* Parchment and brass, shared with the traveller's satchel. */
#hud .inventory-footer { display: flex; }
#hud .inventory-footer > button { flex: 1; min-width: 0; }
#hud #death-recovery { color: #63564c; font-size: 12px; }
.death-panel { width: min(850px, calc(100vw - 32px)); }
#hud .death-panel .panel-body { max-height: min(650px, calc(100dvh - 205px)); overflow-y: auto; }
.death-intro { display: flex; gap: 18px; align-items: center; margin-bottom: 20px; }
.death-intro > .icon { width: 54px; height: 54px; color: #5c746c; flex-shrink: 0; }
.death-intro p { margin: 0; line-height: 1.6; }
.death-intro span { color: #72624d; font-size: 13px; }
.death-tabs { display: flex; border-block: 1px solid #96784960; margin-bottom: 20px; }
.death-tabs button { flex: 1; padding: 12px 6px; font: 15px Georgia, serif; color: #6c5940; border: 0; background: transparent; }
.death-tabs button[aria-pressed='true'] { background: #ae89532b; color: #813f31; box-shadow: inset 0 -3px #956d43; }
.grave-card { border: 3px double #98784c77; margin-bottom: 18px; background: #f0e4c640; }
.grave-card > header { display: flex; gap: 12px; justify-content: space-between; padding: 16px; background: #60796b12; border-bottom: 1px solid #8d794340; }
.grave-card header h3 { margin: 5px 0; font: 21px Georgia, serif; color: #5d513b; }
.grave-card header small { font: 9px ui-sans-serif, sans-serif; letter-spacing: 1.4px; }
.grave-card header span, .grave-card footer > span { font: 12px ui-sans-serif, sans-serif; color: #73624c; }
.grave-clock { text-align: right; min-width: 145px; font-variant-numeric: tabular-nums; }
.grave-clock strong { display: block; font: 29px Georgia, serif; }
.grave-clock small { display: block; margin-top: 6px; letter-spacing: 0 !important; }
.grave-clock.expiring, .death-tracker.expiring { color: #9a3e2c; }
.grave-items { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
.death-item { display: grid; grid-template-columns: 45px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 11px; border: 1px solid #967c4540; background: #f4e8cf50; }
.death-item > .icon { width: 43px; height: 43px; }
.death-item strong { display: block; font: 15px Georgia, serif; }
.death-item small { display: block; font: 11px/1.5 ui-sans-serif, sans-serif; color: #78664e; }
.death-item button { padding: 6px 9px; font: 12px Georgia, serif; border: 1px solid #98744870; background: #cfb58444; color: #624831; }
.death-item button:disabled { opacity: .5; cursor: default; }
.death-item .recovery-fate { grid-column: 1 / -1; color: #73604a; font: 10px ui-sans-serif, sans-serif; }
.death-item > button { grid-row: 3; }
.death-item > button:last-child { grid-column: 2 / 4; }
.death-item-actions { grid-column: 1 / -1; display: flex; gap: 6px; }
.death-item-actions button { flex: 1; }
.grave-card > footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border-top: 1px solid #8d794340; }
.grave-card .primary-button { font-size: 13px; padding: 9px 12px; }
.spirit-summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; background: #596b7212; border: 1px solid #7b777648; padding: 16px; margin-bottom: 16px; }
.spirit-summary > div { display: grid; grid-template-columns: 32px auto; gap: 5px 9px; align-items: center; }
.spirit-summary .icon { width: 32px; height: 32px; grid-row: span 2; }
.spirit-summary small { font: 9px ui-sans-serif, sans-serif; letter-spacing: 1px; color: #7a6b56; }
.spirit-summary p { margin: 0; font-size: 13px; line-height: 1.6; }
.spirit-items { display: grid; gap: 9px; }
.spirit-item { grid-template-columns: 48px minmax(120px, 1fr) minmax(150px, 1fr) 68px; }
.spirit-item .spirit-price { font-size: 16px; color: #7d5332; }
.spirit-item label { font: 10px ui-sans-serif, sans-serif; }
.spirit-item input { display: block; width: 62px; margin-top: 5px; padding: 6px; background: #f3e6c9; border: 1px solid #a18a63; color: #594932; }
.spirit-item > button:last-child { grid-column: 2 / -1; grid-row: 2; }
.death-empty { text-align: center; padding: 28px 24px; color: #76654c; }
.death-empty > .icon { width: 60px; height: 60px; color: #8a9a87; }
.death-empty h3 { font: 24px Georgia, serif; color: #645a40; }
.death-empty p, .death-note { font-size: 13px; line-height: 1.6; }
.death-note { padding-top: 16px; border-top: 1px solid #96744840; color: #7c634b; }
.protection-heading { display: flex; gap: 16px; align-items: center; color: #4e654d; }
.protection-heading > .icon { width: 52px; height: 52px; flex-shrink: 0; }
.protection-heading h3 { margin: 0 0 6px; font: 21px Georgia, serif; }
.protection-heading p { margin: 0; font-size: 13px; line-height: 1.6; color: #716049; }
.protection-heading.is-skulled { color: #963f32; }
.protection-items { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.protection-items .death-item > span { font: 10px ui-sans-serif, sans-serif; color: #77664c; }
.protection-items.kept .death-item { border-left: 3px solid #78906a; }
.protection-items.lost .death-item { border-left: 3px solid #ae8456; }
.death-section-title { font: 18px Georgia, serif; margin: 21px 0 10px; }
#death-feedback { min-height: 1em; color: #526d4b; font: 13px/1.5 Georgia, serif; }
#death-feedback.is-error { color: #923f31; }
.death-tracker { position: absolute; left: 24px; top: 24px; display: flex; gap: 10px; align-items: center; padding: 10px 14px; pointer-events: auto; background: #eadcbfea; border: 3px double #8e7659; color: #635640; box-shadow: 0 4px 15px #17272125; }
.death-tracker .icon { width: 28px; height: 34px; }
.death-tracker strong, .death-tracker small { display: block; text-align: left; }
.death-tracker small { font: 10px/1.8 ui-sans-serif, sans-serif; }
.grave-world-label { position: absolute; transform: translate(-50%, -100%); display: flex; align-items: center; gap: 6px; pointer-events: auto; border: 1px solid #c6b587; padding: 5px 9px; color: #f1e3bf; background: #34443bdc; font: 12px Georgia, serif; white-space: nowrap; }
.grave-world-label .icon { width: 20px; height: 20px; }
.grave-world-label small { font-variant-numeric: tabular-nums; color: #d5b984; }
#hud.is-defeated :is(.chat, .inventory-grid, .actionbar, .map-cluster, .corner-tools, .provisions-hud) { opacity: .12; pointer-events: none; }
#hud.is-defeated :is(#toast, #region-reveal, #interaction, #combat-feedback, .chronicle-tab) { visibility: hidden; }
.death-veil { position: absolute; inset: 0; z-index: 85; pointer-events: all; display: grid; align-items: end; justify-items: center; padding: 16px 16px clamp(20px, 5vh, 48px); background: radial-gradient(ellipse at 50% 42%, #17242500 25%, #19282975); animation: death-veil-in .4s ease-out both; }
.death-veil section { position: relative; width: min(460px, 100%); box-sizing: border-box; text-align: center; color: #f0e6cd; text-shadow: 0 2px 6px #1b2729; padding: 22px 28px 16px; border: 1px solid #c3aa7650; border-radius: 3px; background: linear-gradient(145deg, #283a35ed, #1e2c2aed); box-shadow: 0 12px 40px #101a1938, inset 0 0 0 3px #c3aa7609; animation: death-card-in .5s ease-out both; }
.death-emblem { position: absolute; top: -19px; left: calc(50% - 19px); width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #bba17070; border-radius: 50%; background: #2d3d35; }
.death-emblem .icon { width: 23px; height: 23px; color: #dcc797; }
.death-veil small { letter-spacing: 2.5px; font: 9px ui-sans-serif, sans-serif; color: #c5b992; }
.death-veil h2 { margin: 8px 0; font: 30px Georgia, serif; font-weight: normal; }
.death-veil .death-return { margin: 0; font: 13px/1.5 Georgia, serif; color: #d6d9c7; }
.death-veil b { display: inline-block; min-width: 3ch; margin-left: 7px; color: #dfc797; font: 12px ui-sans-serif, sans-serif; font-variant-numeric: tabular-nums; }
.death-return-track { height: 2px; margin: 15px auto; width: 85%; overflow: hidden; background: #c6b17c25; }
.death-return-track span { display: block; height: 100%; transform: scaleX(var(--return-progress, 0)); transform-origin: left; background: linear-gradient(90deg, #8a9d83, #dbc28b); }
.death-receipt { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; font: 11px ui-sans-serif, sans-serif; color: #d5d5bf; }
.death-receipt > span { display: inline-flex; align-items: center; gap: 5px; }
.death-receipt .icon { width: 15px; height: 15px; color: #b7c09c; }
.death-veil .death-reassurance { margin: 10px 0 0; color: #aab8a8; font: italic 12px Georgia, serif; }
@keyframes death-veil-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes death-card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .death-veil, .death-veil section { animation: none; } }
@media (max-height: 700px) {
  .death-veil section { padding: 16px 20px 12px; }
  .death-veil h2 { font-size: 24px; margin: 6px 0; }
  .death-veil .death-reassurance { margin-top: 7px; }
  .death-return-track { margin-block: 10px; }
  .death-emblem { width: 30px; height: 30px; top: -15px; left: calc(50% - 15px); }
  .death-emblem .icon { width: 19px; height: 19px; }
}
.death-veil[hidden], .death-tracker[hidden], .grave-world-label[hidden] { display: none; }
@media (max-width: 650px) {
  .grave-items, .protection-items { grid-template-columns: 1fr; }
  .grave-card > header, .grave-card > footer, .spirit-summary { flex-direction: column; align-items: stretch; }
  .grave-clock { text-align: left; }
  .spirit-item { grid-template-columns: 40px 1fr 65px; }
  .spirit-item .spirit-price { grid-column: 2; }
  .spirit-item label { grid-column: 3; grid-row: 1 / 3; }
  .spirit-item > button:last-child { grid-row: 3; }
  .death-tabs button { font-size: 12px; }
  .death-tracker { left: 12px; top: 12px; max-width: 55vw; }
  .death-veil section { padding-inline: 16px; }
  .death-veil h2 { font-size: 24px; }
}
