/* Page sheet for deaths.php. Linked after style.css by includes/css.php,
   so these rules win ties against the shared sheet. */

/* ── Deaths feed ────────────────────────────────── */
.deaths-feed {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

/* ── Death card — glass surface ─────────────────── */
.death-card {
    position: relative;
    background: rgba(18, 18, 20, 0.85);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 22px 26px 20px;
    transition: border-color 0.25s, transform 0.18s, box-shadow 0.25s;
    overflow: hidden;
    contain: layout paint style;
    content-visibility: auto;
    contain-intrinsic-size: 0 130px;
}

.death-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}

/* ── PvP — red-tinted glass ─────────────────────── */
.death-card.pvp {
    border-color: rgba(154, 35, 35, 0.28);
    background: rgba(154, 35, 35, 0.07);
}

.death-card.pvp::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 0% 50%, rgba(154, 35, 35, 0.14) 0%, transparent 60%),
        radial-gradient(ellipse at 100% 0%, rgba(154, 35, 35, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.death-card.pvp:hover {
    border-color: rgba(154, 35, 35, 0.5);
    box-shadow: 0 8px 40px rgba(154, 35, 35, 0.18);
}

/* Content above glow */
.death-card > * { position: relative; z-index: 1; }

/* ── Header row ─────────────────────────────────── */
.death-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.death-players {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.death-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

/* Glow lives on the parent; the mask lives on ::before, because the CSS
   pipeline applies filter BEFORE mask - a drop-shadow on a masked element
   gets clipped away to the icon silhouette. Splitting them keeps the glow. */
.death-separator,
.death-skull {
    flex-shrink: 0;
    display: inline-block;
    line-height: 0;
    animation: ember-flicker-icon 2.6s ease-in-out infinite;
}

.death-separator::before,
.death-skull::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background-color: currentColor;
    -webkit-mask: var(--icon) no-repeat center / contain;
            mask: var(--icon) no-repeat center / contain;
}

.death-separator {
    --icon: url('img/icons/blade-drag.svg');
    width: 17px;
    height: 17px;
    color: var(--text-mid);
    opacity: 0.55;
}

.death-skull {
    --icon: url('img/icons/skull-crossed-bones.svg');
    width: 15px;
    height: 15px;
    color: var(--accent);
    opacity: 0.85;
}

.death-card.pvp .death-skull     { opacity: 0.95; }

.death-killer {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-mid);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

/* ── Name + level pair ──────────────────────────────
   The pill sits BESIDE the name span, not inside it: .death-name and
   .death-killer clip with an ellipsis at 220px, which would eat the
   level off any long name. But as a bare sibling of .death-players
   (flex-wrap: wrap) the pill can wrap away from its own name on a
   phone — "Killer Lvl 118 ⚔ Victim" then "Lvl 97 💀", which reads as
   the wrong player's level. Grouping the pair in a nowrap flex box
   makes them break to the next line together. The blade/skull sit
   inside the group too, so the row breaks into two clean halves rather
   than stranding a lone icon on its own line (the extra pill width
   makes that easy to trigger). min-width: 0 keeps the name's ellipsis
   working inside the group. */
.death-side {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* Green is the site-wide level colour
   (style.css .lvl-badge, .podium-meta .lvl, .badge-pve). */
.death-lvl {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 3px;
    line-height: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--sage);
    background: rgba(111, 143, 95, 0.08);
    border: 1px solid rgba(111, 143, 95, 0.18);
}

/* The green reads muddy over the red PvP wash — lift it slightly. */
.death-card.pvp .death-lvl {
    color: #83a471;
    background: rgba(111, 143, 95, 0.1);
    border-color: rgba(111, 143, 95, 0.24);
}

/* ── Badge ──────────────────────────────────────── */
.death-badge {
    flex-shrink: 0;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 3px;
    line-height: 1;
}

.badge-pvp {
    color: #fff;
    background: var(--accent);
}

.badge-pve {
    color: var(--sage);
    background: rgba(111, 143, 95, 0.08);
    border: 1px solid rgba(111, 143, 95, 0.18);
}

/* ── Timestamp ──────────────────────────────────── */
.death-time {
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.death-time svg { opacity: 0.35; flex-shrink: 0; }

/* ── Dropped items ──────────────────────────────── */
.death-drops {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.drops-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.drops-label svg { opacity: 0.3; }

.drops-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.drop-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.78rem;
    color: var(--text-mid);
    transition: border-color 0.2s, color 0.2s;
    line-height: 1.3;
}

.death-card.pvp .drop-chip {
    border-color: rgba(154, 35, 35, 0.18);
    background: rgba(154, 35, 35, 0.04);
}

.drop-chip:hover {
    border-color: var(--border-light);
    color: var(--text-main);
}

.drop-chip svg { opacity: 0.25; flex-shrink: 0; }

/* ── Destroyed items (ember / burning glow) ─────── */
.destroyed-chip svg { color: #c4612a; opacity: 0.6; }
.destroyed-chip .item-link {
    color: #d8a87a;
    text-shadow:
        0 0 4px rgba(196, 97, 42, 0.55),
        0 0 10px rgba(154, 35, 35, 0.35);
    animation: ember-flicker 2.6s ease-in-out infinite;
}
.destroyed-chip .item-link:hover {
    color: #f0c89a;
    text-shadow:
        0 0 6px rgba(220, 130, 60, 0.8),
        0 0 14px rgba(180, 50, 40, 0.5);
}

/* ── Items lost on death (body + backpack) — cool steel ─────── */
.lost-label { color: #8291a6; }
.lost-label svg { opacity: 0.7; }
.lost-group { margin-top: 10px; }
.lost-group + .lost-group { margin-top: 12px; }
.lost-group-label {
    display: block;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 7px;
}
.lost-chip svg { color: #7f8ea3; opacity: 0.55; }
.lost-chip .item-link { color: #b6c0cf; }
.lost-chip:hover .item-link { color: #e6ecf4; }
.death-card.pvp .lost-chip {
    border-color: rgba(130, 145, 166, 0.18);
    background: rgba(130, 145, 166, 0.05);
}

/* ── Last destroyed panel ───────────────────────── */
.last-destroyed {
    background: rgba(40, 20, 15, 0.35);
    border: 1px solid rgba(196, 97, 42, 0.22);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 22px;
}
.last-destroyed-label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #c4612a;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.last-destroyed-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.last-destroyed-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 0.88rem;
    padding: 4px 0;
}
.last-destroyed-row .ld-item {
    color: #d8a87a;
    text-shadow:
        0 0 4px rgba(196, 97, 42, 0.55),
        0 0 10px rgba(154, 35, 35, 0.35);
    animation: ember-flicker 2.6s ease-in-out infinite;
    font-weight: 600;
}
.last-destroyed-row .ld-item:hover {
    color: #f0c89a;
}
.last-destroyed-row .ld-meta {
    color: var(--text-dim);
    font-size: 0.76rem;
    white-space: nowrap;
}
.last-destroyed-row .ld-meta a { color: var(--text-mid); }
.last-destroyed-row .ld-meta a:hover { color: var(--text-main); }
.last-destroyed-empty {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-style: italic;
}

/* ── Live search input ──────────────────────────── */
.ld-search {
    display: block;
    margin-bottom: 22px;
    width: 100%;
    padding: 9px 14px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-main);
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.ld-search:focus {
    outline: none;
    border-color: rgba(196, 97, 42, 0.5);
}
.ld-search::placeholder { color: var(--text-dim); }

@keyframes ember-flicker {
    0%, 100% {
        text-shadow:
            0 0 4px rgba(196, 97, 42, 0.55),
            0 0 10px rgba(154, 35, 35, 0.35);
    }
    45% {
        text-shadow:
            0 0 5px rgba(210, 110, 50, 0.7),
            0 0 12px rgba(170, 45, 35, 0.45);
    }
    70% {
        text-shadow:
            0 0 3px rgba(180, 85, 35, 0.45),
            0 0 8px rgba(140, 30, 30, 0.3);
    }
}

/* Same ember glow, ported to drop-shadow for the masked sword/skull icons */
@keyframes ember-flicker-icon {
    0%, 100% {
        filter: drop-shadow(0 0 3px rgba(196, 97, 42, 0.36)) drop-shadow(0 0 8px rgba(154, 35, 35, 0.22));
    }
    45% {
        filter: drop-shadow(0 0 4px rgba(210, 110, 50, 0.46)) drop-shadow(0 0 10px rgba(170, 45, 35, 0.3));
    }
    70% {
        filter: drop-shadow(0 0 2px rgba(180, 85, 35, 0.3)) drop-shadow(0 0 6px rgba(140, 30, 30, 0.2));
    }
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 600px) {
    .death-card { padding: 16px 18px 14px; }
    .death-header { gap: 8px; }
    .death-name, .death-killer { max-width: 120px; font-size: 0.85rem; }
}
/* ── Type filter toolbar ────────────────────────── */
.death-filter { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
/* Look comes from THE SWITCH primitive in style.css. */
.death-filter a { --tab-px: 22px; --tab-py: 8px; }

/* ── Deadliest monster panel ────────────────────── */
.deadliest {
    background: rgba(154, 35, 35, 0.06);
    border: 1px solid rgba(154, 35, 35, 0.28);
    border-radius: 8px;
    padding: 22px 26px;
    margin-bottom: 22px;
}
.deadliest-label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.deadliest-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.deadliest-name {
    font-family: 'Beaulieux', sans-serif;
    font-size: clamp(1.3rem, 3.5vw, 1.9rem);
    color: var(--text-main);
    letter-spacing: 0.04em;
}
.deadliest-kills { color: var(--accent); font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums; }
.deadliest-rest { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.deadliest-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-mid);
}
.deadliest-row span:last-child { color: var(--text-dim); font-variant-numeric: tabular-nums; }