/* HUD v2: cut-corner panels with corner brackets, a faint cell-noise surface (Title FX pack), scanlines,
   a radar watermark on the menus (Title FX pack) and cards with the pack's models rendered as icons */
#hud, #panel {
  --cut: 10px; --acc: rgba(57, 255, 224, .85); --acc2: rgba(255, 43, 214, .75);
  --surface: linear-gradient(160deg, rgba(18, 22, 58, .86), rgba(7, 9, 26, .8));
}
.tm, #leftbottom, #weaponbar, #topmid, .slot, #feed > div, #panel .panel, #toast, #lockhint, #buffs .buff {
  background: var(--surface) !important; border: 1px solid rgba(120, 150, 255, .22) !important;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 0 24px rgba(80, 100, 255, .07); border-radius: 0 !important;
}
/* (the absolutely placed HUD pieces keep their position; the rest anchor their decorations) */
.tm, .slot, #feed > div, #panel .panel, #buffs .buff { position: relative; }
.tm::before, #leftbottom::before, #weaponbar::before, #topmid::before, .slot::before, #panel .panel::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .028) 0 1px, transparent 1px 3px), url('../assets/ui/cells.png') center / 240px;
  opacity: .5; mix-blend-mode: soft-light;
}
.tm::after, #leftbottom::after, #weaponbar::after, #topmid::after, #panel .panel::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    linear-gradient(var(--acc), var(--acc)) top right / 16px 2px no-repeat,
    linear-gradient(var(--acc), var(--acc)) top right / 2px 16px no-repeat,
    linear-gradient(var(--acc2), var(--acc2)) bottom left / 16px 2px no-repeat,
    linear-gradient(var(--acc2), var(--acc2)) bottom left / 2px 16px no-repeat,
    linear-gradient(90deg, transparent, rgba(57, 255, 224, .5) 30%, rgba(255, 43, 214, .4) 70%, transparent) top left / 100% 1px no-repeat;
}
#panel .panel::before { opacity: .16; background-size: auto, 320px; }
#leftbottom > *, #weaponbar > *, #topmid > *, .tm > *, #panel .panel > * { position: relative; z-index: 1; }
.tm { padding: 6px 12px 6px 10px; }
#topmid { padding: 3px 18px 5px; }
#clock { letter-spacing: .06em; }

/* health: segmented, with a white trail that catches up after a hit */
#leftbottom .bar.hp { overflow: hidden; background: rgba(0, 0, 0, .6); }
#hpdmg { position: absolute; left: 0; top: 0; height: 100%; width: 100%; background: rgba(255, 255, 255, .75); transition: width .5s .25s ease-out; }
#hpfill { transition: width .08s !important; }
#leftbottom .bar.hp::after, #leftbottom .bar.pack::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(5, 6, 18, .85) calc(10% - 2px) 10%);
}
#leftbottom .bar.pack::after { background: repeating-linear-gradient(90deg, transparent 0 calc(5% - 1px), rgba(5, 6, 18, .7) calc(5% - 1px) 5%); }
#leftbottom .bar span { z-index: 3; }
#bank b { font-family: 'Lilita', sans-serif; font-weight: normal; font-size: 17px; color: #fff; }

/* item slots: rendered models */
.slot { width: 58px; height: 58px; --cut: 8px; }
.slot .mi { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); position: relative; z-index: 1; }
.slot .k, .slot .n { z-index: 2; }
.slot .k { font: 11px 'Lilita', sans-serif; color: var(--cyan); }
.slot .n { font: 14px 'Lilita', sans-serif; text-shadow: 0 1px 2px #000; }
.slot:not(.empty) { box-shadow: inset 0 0 18px rgba(57, 255, 224, .12), inset 0 1px 0 rgba(255, 255, 255, .08); }
body.touch .slot { width: 44px; height: 44px; }
body.touch .slot .mi { width: 34px; height: 34px; }

/* power-ups running: icon in a ring that empties as it runs out */
#buffs { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); display: flex; gap: 6px; pointer-events: none; }
#buffs .buff { --cut: 7px; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; }
#buffs .buff::before {
  content: ''; position: absolute; inset: 3px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--f) * 360deg), rgba(255, 255, 255, .08) 0);
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 62%); mask: radial-gradient(circle, transparent 60%, #000 62%);
}
#buffs .buff .mi { width: 32px; height: 32px; object-fit: contain; position: relative; }
#buffs .buff b { position: absolute; right: 4px; bottom: 1px; font: 12px 'Lilita', sans-serif; text-shadow: 0 1px 2px #000; }
body.touch #buffs { bottom: auto; top: 84px; }

/* weapon bar */
#weaponbar { padding: 8px 14px; gap: 12px; }
#wname { color: #fff; text-shadow: 0 0 8px rgba(57, 255, 224, .55); }

/* menus */
#panel { background: radial-gradient(ellipse at center, rgba(20, 10, 50, .45), rgba(0, 0, 0, .55)); }
#panel .panel { --cut: 18px; padding: 18px 20px; box-shadow: 0 0 40px rgba(80, 60, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .08); }
#panel .panel.wide { background: url('../assets/ui/radar_dim.png') right -70px top -80px / 300px no-repeat, var(--surface) !important; }
#panelbody h2 {
  font-size: 26px; flex-wrap: wrap; text-shadow: 0 0 14px rgba(57, 255, 224, .35); padding-bottom: 8px; margin-bottom: 6px;
  border-bottom: 1px solid transparent; border-image: linear-gradient(90deg, var(--cyan), var(--pink) 60%, transparent) 1;
}
#panelbody h2 .kicker { flex-basis: 100%; font-size: 11px; letter-spacing: .35em; color: var(--pink); text-shadow: 0 0 8px rgba(255, 43, 214, .6); margin-bottom: -4px; }
#panelbody h2 .lvl { font-size: 13px; padding: 2px 8px; color: #08081a; background: var(--cyan); clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); letter-spacing: .1em; }
#panelbody h2 .mi.head { width: 44px; height: 44px; object-fit: contain; }
.grid { gap: 10px; }
.card {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto 1fr auto; column-gap: 10px; align-items: start;
  background: linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015)); border: 1px solid rgba(120, 150, 255, .25); border-radius: 0;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: transform .12s, border-color .12s, background .12s; padding: 10px;
}
.card .ic {
  grid-row: 1 / 4; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: radial-gradient(circle at 50% 55%, rgba(57, 255, 224, .22), transparent 65%);
}
.card .ic .mi { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .6)); transition: transform .2s; }
.card .cn { margin: 0; }
.card .cost {
  justify-self: start; padding: 2px 9px; font: 13px 'Lilita', sans-serif; letter-spacing: .05em; color: #08081a; background: #ffd23b;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.card:hover:not(.no) { transform: translateY(-2px); border-color: var(--cyan); background: linear-gradient(160deg, rgba(57, 255, 224, .14), rgba(255, 43, 214, .05)); }
.card:hover:not(.no) .ic .mi { transform: scale(1.12) rotate(-4deg); }
.card::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .14) 50%, transparent 65%); transform: translateX(-120%); }
.card:hover:not(.no)::after { transform: translateX(120%); transition: transform .6s ease-out; }
.card.no { filter: grayscale(.85); }
.card.owned .cost { background: var(--cyan); }
.epics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.epic {
  display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; font: 14px 'Lilita', sans-serif;
  background: rgba(255, 177, 59, .12); border: 1px solid rgba(255, 177, 59, .5); clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.epic .mi { width: 32px; height: 32px; object-fit: contain; }
body.touch .card { grid-template-columns: 48px 1fr; }
body.touch .card .ic, body.touch .card .ic .mi { width: 48px; height: 48px; }
