/* ============ Last Light — UI widgets (toasts, tooltips, gumps, HUD content, result) ============ */

/* toasts */
#toasts { position: fixed; right: 16px; bottom: 120px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; z-index: 60; pointer-events: none; }
.toast { background: rgba(27, 21, 16, 0.94); border: 1px solid #6a5232; color: #e8d9b5; padding: 6px 12px; font: 13px var(--f-text); border-radius: 3px; box-shadow: 0 2px 10px #000a; transition: opacity .6s; max-width: 360px; }
.toast-skill { border-color: #4f7fbf; color: #a9cdff; }
.toast.fade { opacity: 0; }

/* tooltip */
#tooltip { position: fixed; z-index: 80; pointer-events: none; min-width: 200px; max-width: 300px; background: rgba(16, 12, 9, 0.97); border: 1px solid #8a6a3e; padding: 8px 10px; font: 12.5px/1.4 var(--f-text); color: #ddd0b0; box-shadow: 0 4px 16px #000c; border-radius: 3px; }
.tt-name { font-size: 15px; font-weight: bold; }
.tt-sub { color: #9a8a6a; font-style: italic; margin-bottom: 4px; }
.tt-affix { color: #9fd0ff; }
.tt-set { margin-top: 4px; font-size: 12px; }
.tt-unique { color: #ff9d2e; margin-top: 4px; font-style: italic; }
.tt-dim { color: #7a6e58; font-size: 11.5px; margin-top: 3px; }

/* item cells */
.item-cell { --tier: #a8a39a; width: 48px; height: 48px; flex: none; box-sizing: border-box; border: 2px solid var(--tier); border-radius: 4px; background: radial-gradient(circle at 50% 55%, #2a2118, #120e0a); box-shadow: 0 0 6px -1px var(--tier), inset 0 0 8px #000; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .1s, box-shadow .1s; }
.item-cell img { width: 44px; height: 44px; image-rendering: auto; pointer-events: none; }
.item-cell:hover { transform: translateY(-1px); box-shadow: 0 0 12px 1px var(--tier), inset 0 0 8px #000; }
.item-cell.empty { border: 1px dashed #4a3a24; box-shadow: inset 0 0 8px #000; cursor: default; }

/* gump chrome */
.gump-title { display: flex; justify-content: space-between; align-items: center; font: bold 15px var(--f-text); color: #e8cf8a; letter-spacing: .5px; padding-bottom: 6px; margin-bottom: 8px; border-bottom: 1px solid #4a3a24; }
.gump-title .x { background: none; border: none; color: #a08a60; font-size: 14px; cursor: pointer; }
.gump-title .x:hover { color: #fff; }
.gump-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }

/* loot window */
#lootwin { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); width: 320px; max-height: 60vh; overflow: auto; z-index: 30; padding: 10px 12px; }
#lootwin .rows { display: flex; flex-direction: column; gap: 4px; }
#lootwin .row { display: flex; align-items: center; gap: 10px; padding: 4px; border-radius: 3px; cursor: pointer; }
#lootwin .row:hover { background: #2e2418; }
#lootwin .rname { font: 13.5px var(--f-text); display: flex; flex-direction: column; }
#lootwin .rname small { color: #8a7a5a; font-size: 11px; }
#lootwin .empty { padding: 10px 0; text-align: center; }

/* inventory / paperdoll */
#invwin { position: fixed; right: 16px; top: 170px; width: 470px; z-index: 30; padding: 10px 12px; max-height: calc(100vh - 300px); overflow: auto; }
.inv-body { display: flex; gap: 12px; }
.doll-col { width: 170px; flex: none; }
.doll { display: block; margin: 0 auto; background: radial-gradient(circle at 50% 60%, #241a10, #0e0a07); border: 1px solid #4a3a24; border-radius: 4px; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 6px; }
.slot { display: flex; flex-direction: column; align-items: center; }
.slabel { font: 10px var(--f-text); color: #8a7a5a; }
.stat-col { flex: 1; font: 12.5px var(--f-text); color: #d8c9a3; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; margin-bottom: 6px; }
.stats b { color: #f0e2bc; }
.stat-col .sub { margin: 8px 0 4px; color: #e8cf8a; }
.pack { display: flex; flex-wrap: wrap; gap: 4px; }
.warn { color: #ff6a5a !important; }

/* HUD inner content */
#timer { font: bold 26px var(--f-text); color: #f0e2bc; text-shadow: 0 2px 6px #000; }
#timer.late { color: #ff6a5a; animation: llpulse 1s infinite; }
#portalinfo { font: 14px var(--f-text); color: #cfe8f0; text-shadow: 0 1px 4px #000; }
#portalinfo .open { color: #7ff0ff; font-weight: bold; animation: llpulse 1.4s infinite; }
#portalinfo .warn, #zoneinfo .warn { color: #c486ff !important; font-weight: bold; }
#zoneinfo { font: italic 13px var(--f-text); color: #a8987a; text-shadow: 0 1px 4px #000; }
#banner { font: bold 20px var(--f-text); text-align: center; text-shadow: 0 2px 8px #000, 0 0 18px #000; transition: opacity .4s; pointer-events: none; }
#feed { font: 13px var(--f-text); text-shadow: 0 1px 3px #000, 0 0 6px #000; line-height: 1.45; pointer-events: none; }
.bar { position: relative; overflow: hidden; }
.bar span { position: relative; z-index: 1; font: 12px var(--f-text); color: #fff; text-shadow: 0 1px 2px #000; }
.fill { transition: width .15s; }
.fill.wt.over { background: linear-gradient(#ff6a4a, #a02a1a) !important; }
#quick { display: flex; gap: 14px; font: 13px var(--f-text); color: #e8d9b5; text-shadow: 0 1px 3px #000; flex-wrap: wrap; }
#quick small { color: #8a7a5a; }
#quick .lit { color: #ffcf8a; }
#quick .unlit { color: #8a8aa8; }
#quick .lootv { color: #9fe08a; } #quick .lootv b { color: #c8ffb0; }
#quick .stashv { color: #c8b890; } #quick .stashv b { color: #ffe0a0; }
#invwin .inv-values { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: #b8a888; margin: 8px 0 2px; padding: 5px 8px; background: rgba(0,0,0,.25); border: 1px solid #3e2f1d; border-radius: 4px; }
#invwin .inv-values b { color: #ffe0a0; }
#quick .gold { color: #ffd24a; font-weight: bold; }
#quick .murder { color: #ff4a3a; font-weight: bold; }
#quick .reveal { color: #ff9d2e; font-weight: bold; animation: llpulse 1s infinite; }
@keyframes llpulse { 50% { opacity: .55; } }

/* modal */
#modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72); z-index: 70; display: flex; align-items: center; justify-content: center; }
#modal.hidden { display: none !important; }
.modal-box { max-width: 480px; padding: 18px 20px; color: #e0d2ad; font: 14px/1.5 var(--f-text); box-shadow: 0 10px 40px #000; }
.modal-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* result screen */
#result { position: fixed; inset: 0; z-index: 65; background: radial-gradient(circle at 50% 40%, rgba(30, 20, 10, 0.9), rgba(0, 0, 0, 0.97)); display: flex; align-items: center; justify-content: center; }
#result.hidden { display: none !important; }
.res-box { width: min(640px, 92vw); max-height: 88vh; overflow: auto; padding: 24px 28px; text-align: center; color: #e0d2ad; font: 14px var(--f-text); }
.res-box h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: 1px; }
.res-box.win h1 { color: #ffd77a; text-shadow: 0 0 20px #ff9a40; }
.res-box.lose h1 { color: #d84a3a; text-shadow: 0 0 20px #600; }
.res-sub { color: #a8987a; font-style: italic; margin-bottom: 10px; }
.res-box h3 { color: #e8cf8a; margin: 16px 0 8px; font-weight: normal; letter-spacing: 1px; text-transform: uppercase; font-size: 13px; }
.res-grid { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.lost .item-cell { filter: grayscale(0.85) brightness(0.6); position: relative; }
.lost .item-cell::after { content: ''; position: absolute; left: 4px; right: 4px; top: 50%; border-top: 2px solid #c33; transform: rotate(-35deg); }
.res-key { margin-top: 12px; color: #ffcf7a; }
.res-stats { display: flex; gap: 18px; justify-content: center; margin-top: 16px; color: #b8a888; }
.res-skills { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; color: #a9cdff; }
.res-btns { margin-top: 22px; }

/* divine mods on Demi-God / Holy items */
.tt-divine { font-weight: bold; margin-top: 2px; }
.tt-ability { margin-top: 4px; color: #9ad8ff; }
.tt-ability span { color: #b8c8d0; font-size: 12px; }

/* ---------- item ability hotbar ---------- */
#abilitybar { position: absolute; bottom: 146px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; pointer-events: auto; }
#abilitybar .ab { position: relative; width: 62px; height: 62px; border: 2px solid var(--ab); border-radius: 6px; background: rgba(14,10,7,.88);
  box-shadow: 0 0 10px color-mix(in srgb, var(--ab) 45%, transparent); cursor: pointer; overflow: hidden; display: flex; align-items: center; justify-content: center; }
#abilitybar .ab img { width: 40px; height: 40px; pointer-events: none; }
#abilitybar .abk { position: absolute; top: 1px; left: 4px; font: bold 13px var(--f-text); color: #fff; text-shadow: 0 0 3px #000; }
#abilitybar .abn { position: absolute; bottom: 1px; left: 0; right: 0; text-align: center; font-size: 9.5px; color: #e8dcc0; text-shadow: 0 0 3px #000; white-space: nowrap; overflow: hidden; }
#abilitybar .cd { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(0,0,0,.68); pointer-events: none; }
#abilitybar .cdt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: bold 20px var(--f-text); color: #fff; text-shadow: 0 0 4px #000; pointer-events: none; }
#abilitybar .ab.nomana { filter: grayscale(.8) brightness(.7); }
#abilitybar .ab-empty { font-size: 12px; color: #8a7a5a; background: rgba(12,9,6,.75); padding: 4px 10px; border-radius: 4px; }

/* ---------- pack button, abilities list, drag targets ---------- */
#quick { pointer-events: auto; }
.hud-btn { font: 12.5px var(--f-text); color: #f0dcb0; background: #3a2a18; border: 1px solid #8a6a3a; border-radius: 3px; padding: 2px 8px; cursor: pointer; }
.hud-btn:hover { background: #5a3e20; }
#lootwin { left: 30%; }
#lootwin .hint { font-size: 11px; margin: 6px 0 2px; }
#invwin .inv-abs { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; }
#invwin .inv-ab { font-size: 13px; border-left: 3px solid var(--ab); padding-left: 6px; }
#invwin .inv-ab b { color: #fff; margin-right: 4px; }
[data-drag] { cursor: grab; }
#invwin .pack { min-height: 56px; border: 1px dashed #4a3a24; border-radius: 4px; padding: 4px; }
#invwin canvas.doll { border-radius: 4px; }

/* gear comparison (tooltips, character screen) */
.cmp { margin-top: 6px; font-size: 12.5px; }
.cmp-head { font-weight: bold; margin-bottom: 3px; }
.cmp-head.cmp-up, .cmp-head.cmp-new { color: #6fe08a; }
.cmp-head.cmp-down { color: #ff6a5a; }
.cmp-head.cmp-side { color: #c8b88a; }
.cmp-vs { font-weight: normal; color: #a89878; font-size: 11.5px; }
.cmp-rows { border-collapse: collapse; width: 100%; }
.cmp-rows td { padding: 0 6px 0 0; white-space: nowrap; }
.cmp-rows td:last-child { text-align: right; padding-right: 0; }
.cmp-rows tr.cmp-good td:last-child, .cmp-note.cmp-good { color: #6fe08a; }
.cmp-rows tr.cmp-bad td:last-child, .cmp-note.cmp-bad { color: #ff6a5a; }
.cmp-note { color: #c8b88a; font-size: 12px; }

/* ---------- bottom HUD: abilities stacked above one compact panel (bars | 3x2 info grid) ---------- */
#hudbottom { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
#hudbottom #abilitybar { position: static; transform: none; }
#hudbottom #abilitybar:empty { display: none; }
#hudbottom #bottombar { position: static; transform: none; gap: 18px; padding: 8px 14px; border-radius: 6px; background: rgba(12,9,6,.82); box-shadow: 0 4px 16px rgba(0,0,0,.55); }
#hudbottom .bars { gap: 5px; }
#hudbottom .bar { width: 230px; height: 16px; border-radius: 8px; }
#hudbottom .bar .fill { border-radius: 8px; }
#hudbottom .bar span { position: absolute; inset: 0; z-index: 1; text-align: center; font: 11.5px/15px var(--f-text); }
#hudbottom #quick { display: grid; grid-template-columns: repeat(3, auto); gap: 4px 16px; align-items: center; white-space: nowrap; }
#hudbottom #quick .hud-btn { justify-self: start; }
/* the event feed stops short of the centred panel on narrower screens */
#feed { width: clamp(200px, calc(50vw - 300px), 460px); }
#keys { right: 14px; }
/* narrow windows: the feed moves above the panel, and the panel clears the two-line key hints */
@media (max-width: 1120px) {
  #feed { bottom: 214px; width: min(360px, calc(100vw - 300px)); }
  #hudbottom { bottom: 44px; }
}
