/* Add dk-leather to the current .dk element; load after hud.css and the previous dock stylesheet.
   The rectangle uses normal grid flow. Its height follows the live controls. */
.dk.dk-leather {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) 76px !important;
  grid-template-areas: "top bottom orb" "energy energy energy" !important;
  align-items: end !important;
  gap: 8px 14px !important;
  position: relative;
  width: min(100%, 760px) !important;
  max-width: 760px !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  margin: 6px auto !important;
  padding: 5px 7px !important;
  border: 10px solid transparent !important;
  border-image: url("assets/ui/hud/oxblood-panel.webp") 48 fill / 10px / 0 stretch !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: 0 3px 10px #0006 !important;
  container-type: inline-size;
  overflow: visible;
}
.dk.dk-leather::before { display: none !important; }
.dk-leather .dk-top,
.dk-leather .dk-bottom,
.dk-leather .dk-orb-wrap,
.dk-leather .dk-energy {
  position: static !important;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  min-width: 0;
  padding: 0 !important;
}
.dk-leather .dk-top { grid-area: top; justify-self: stretch !important; }
.dk-leather .dk-abilities { width: 100% !important; gap: 5px; }
.dk-leather .dk-abilities > .dk-label {
  position: static !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 8px;
}
.dk-leather .dk-label {
  color: #c8b28b;
  font: 11px/1.15 var(--title, Georgia, serif);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.dk-leather .dk-edit { min-height: 22px !important; height: 22px; padding: 0 6px !important; font-size: 11px !important; }
.dk-leather .dk-abilities .dk-row {
  display: grid !important;
  grid-template-columns: repeat(4, 76px);
  width: 100% !important;
  gap: 7px !important;
}
.dk-leather .hot-cell {
  display: block;
  width: 100% !important;
  min-width: 0;
  max-width: none !important;
  flex: none !important;
}
.dk-leather .hot-name { display: none !important; }
.dk-leather .hot-slot {
  display: grid;
  place-items: center;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 1;
  margin: 0;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid #876a41 !important;
  border-radius: 3px !important;
  background: #100c0a !important;
  box-shadow: inset 0 0 0 1px #050404, 0 1px 3px #000b !important;
}
.dk-leather .hot-slot::after { display: none !important; }
.dk-leather .hot-slot .hot-icon { inset: 2px !important; width: auto; height: auto; border-radius: 1px; }
.dk-leather .hot-slot .ab-art { width: 100%; height: 100%; object-fit: cover; }
.dk-leather .hot-slot .hot-timer { z-index: 2; font-size: 19px; }
.dk-leather .hot-slot .hot-key {
  top: 2px !important;
  left: 2px !important;
  min-width: 13px;
  height: 13px;
  padding: 0 2px;
  border: 0;
  background: #100c0bd9;
  font-size: 11px;
  line-height: 13px;
}
.dk-leather .hot-slot .hot-cost { right: 2px !important; bottom: 2px !important; height: 14px; padding: 0 3px; font-size: 11px; line-height: 12px; }
.dk-leather .hot-slot .hot-sweep { inset: 2px !important; border-radius: 1px; }
.dk-leather .hot-slot.is-fired { box-shadow: inset 0 0 0 1px #f4cc81, 0 0 6px #c78f4f !important; }

/* Supplies stay smaller than the skills and retain their current slot actions. */
.dk-leather .dk-bottom {
  grid-area: bottom;
  display: flex !important;
  align-items: end;
  justify-self: stretch !important;
  justify-content: center !important;
  gap: 8px;
  border: 0 !important;
}
.dk-leather .dk-gem { display: none; }
.dk-leather .dk-bottom .dk-group { gap: 5px; }
.dk-leather .dk-bottom .dk-label { justify-content: center; font-size: 11px; }
.dk-leather .dk-bottom .dk-row { display: flex; gap: 5px; width: auto !important; }
.dk-leather .dk-cell {
  width: 46px !important;
  height: 46px !important;
  min-height: 0 !important;
  flex: 0 0 46px;
  aspect-ratio: 1;
  border: 1px solid #6f5635 !important;
  border-radius: 3px !important;
  background: linear-gradient(#17110e, #0b0807) !important;
  box-shadow: inset 0 0 0 1px #000 !important;
}
.dk-leather .dk-cell::after { display: none !important; }
.dk-leather .dk-count { font-size: 11px; }
.dk-leather .dk-sub { top: 1px; left: 1px; font-size: 11px; padding: 0 1px; }
.dk-leather .dk-plus { font-size: 20px; }
.dk-leather .dk-cell .dk-img { width: 76%; height: 76%; }

/* The ultimate is one contained square tile with its existing live charge. */
.dk-leather .dk-orb-wrap {
  grid-area: orb;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-self: end !important;
}
.dk-leather .dk-orb-wrap::before { content: "Ultimate"; color: #d8b97d; text-align: center; font: 11px/1.15 var(--title, Georgia, serif); letter-spacing: .08em; text-transform: uppercase; }
.dk-leather .dk-orb {
  width: 76px !important;
  height: 76px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #c09751 !important;
  border-radius: 3px !important;
  background: #160b09 !important;
  box-shadow: inset 0 0 0 1px #38250e, 0 0 5px #ac792833 !important;
  overflow: hidden !important;
}
.dk-leather .dk-orb::after { display: none !important; }
.dk-leather .dk-orb::before {
  inset: auto 0 0 !important;
  height: 3px;
  z-index: 4;
  border-radius: 0;
  background: linear-gradient(90deg,#e6ba66 calc(var(--fury, 0) * 1%), #231a11 0);
  mask: none;
  -webkit-mask: none;
}
.dk-leather .dk-orb-liquid { inset: 2px !important; height: auto !important; border-radius: 1px; }
.dk-leather .dk-orb-icon { position: absolute; inset: 2px; width: auto; height: auto; display: grid; place-items: center; opacity: .55; border-radius: 1px; }
.dk-leather .dk-orb-icon .ab-art { width: 100%; height: 100%; object-fit: cover; border-radius: 1px; }
.dk-leather .dk-orb-icon svg { width: 75%; height: 75%; }
.dk-leather .dk-orb b,
.dk-leather .dk-orb.is-locked b { margin: 10px 0 0; font: 600 15px/1 var(--title, Georgia, serif); }
.dk-leather .dk-orb small { display: none; }
.dk-leather .dk-orb.is-locked .dk-orb-icon { align-items: start; padding-top: 5px; }
.dk-leather .dk-orb-icon .hot-lock { position: static; font-size: 11px; }
.dk-leather .dk-orb.is-full { animation: rect-ready 1.4s ease-in-out infinite; }

/* Live energy and attack timing occupy one slim bottom rail. */
.dk-leather .dk-energy { grid-area: energy; }
.dk-leather .dk-energy .hot-energy {
  width: 100% !important;
  height: 11px !important;
  min-height: 0;
  margin: 0 !important;
  overflow: hidden !important;
  border: 1px solid #263d35 !important;
  border-radius: 1px !important;
  background: #060907 !important;
}
.dk-leather .dk-energy .hot-energy::after { display: none !important; }
.dk-leather .dk-energy .hot-energy i { position: absolute; inset: 0 auto 0 0; height: 100%; background: var(--hud-teal) !important; clip-path: none; border-radius: 0 !important; }
.dk-leather .dk-energy .hot-energy span { position: absolute; inset: 0; display: grid; place-items: center; font: 600 11px/1 var(--title, Georgia, serif) !important; text-shadow: 0 1px 2px #000; }
.dk-leather .dk-energy .hot-swing { margin: 3px 0 0 !important; height: 2px !important; }
.dk-leather button:focus-visible { outline: 2px solid #f2d9a8 !important; outline-offset: 2px; }

/* Named container supplied by the existing hud.css, or by the preview wrapper. */
@container dock (max-width: 739px) {
  .dk.dk-leather {
    grid-template-columns: minmax(0, 1fr) 48px !important;
    grid-template-areas: "top orb" "bottom bottom" "energy energy" !important;
    border-width: 6px !important;
    border-image-width: 6px !important;
    padding: 5px !important;
    gap: 7px 9px !important;
  }
  .dk-leather .dk-abilities .dk-row { grid-template-columns: repeat(4, minmax(0, 56px)); justify-content: space-between; gap: 5px !important; }
  .dk-leather .dk-label { font-size: 11px; }
  .dk-leather .dk-edit { height: 20px; min-height: 20px !important; font-size: 11px !important; }
  .dk-leather .hot-slot .hot-timer { font-size: 17px; }
  .dk-leather .dk-bottom { justify-content: center !important; gap: 7px; }
  .dk-leather .dk-bottom .dk-row { gap: 5px; }
  .dk-leather .dk-bottom .dk-label { font-size: 11px; }
  .dk-leather .dk-cell { width: 42px !important; height: 42px !important; flex-basis: 42px; }
  .dk-leather .dk-orb-wrap { gap: 5px; }
  .dk-leather .dk-orb-wrap::before { font-size: 11px; }
  .dk-leather .dk-orb { width: 48px !important; height: 48px !important; }
  .dk-leather .dk-orb small { font-size: 6px; }
}
@keyframes rect-ready { 50% { filter: brightness(1.2); } }
@media (prefers-reduced-motion: reduce) { .dk-leather .dk-orb.is-full { animation: none; } }

/* Painted socket rims add the depth and material from the approved leather concept. */
.dk-leather .hot-slot,
.dk-leather .dk-cell,
.dk-leather .dk-orb {
  border: 0 !important;
  background: #0d0806 !important;
  border-radius: 2px !important;
  overflow: hidden !important;
}
.dk-leather .hot-slot::after,
.dk-leather .dk-cell::after,
.dk-leather .dk-orb::after {
  display: block !important;
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: url("assets/ui/hud/oxblood-slot.webp") center / 100% 100% no-repeat;
  pointer-events: none;
}
.dk-leather .hot-slot .hot-icon,
.dk-leather .hot-slot .hot-sweep { inset: 12% !important; border-radius: 1px; }
.dk-leather .hot-slot .hot-key { z-index: 4; top: 8% !important; left: 8% !important; }
.dk-leather .hot-slot .hot-cost { z-index: 4; right: 8% !important; bottom: 8% !important; }
.dk-leather .dk-orb-icon { inset: 12%; }
.dk-leather .dk-orb-liquid { inset: 12% !important; }
.dk-leather .dk-orb b { z-index: 4; text-shadow: 0 1px 3px #000; }
.dk-leather .dk-orb::before { left: 12% !important; right: 12% !important; bottom: 12% !important; z-index: 4; }
.dk-leather .dk-count { z-index: 4; bottom: 8%; right: 8%; }
.dk-leather .dk-sub { z-index: 4; top: 8%; left: 8%; }
.dk-leather .dk-bottom { border-left: 1px solid #c49a5840 !important; padding-left: 10px !important; }
.dk-leather .dk-orb-wrap { border-left: 1px solid #c49a5840; padding-left: 10px !important; box-sizing: content-box; }
@container dock (max-width: 739px) {
  .dk-leather .dk-bottom { border-left: 0 !important; padding-left: 0 !important; }
  .dk-leather .dk-orb-wrap { border-left: 0; padding-left: 0 !important; box-sizing: border-box; }
}

/* No visible labels: the art says what each slot is. Screen readers still hear the group names.
   Edit stays reachable from the Ultimate tile and the Abilities tab. */
.dk-leather .dk-label { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; padding: 0 !important; margin: 0 !important; }
.dk-leather .dk-edit, .dk-leather .dk-orb-wrap::before, .dk-leather .dk-orb-wrap::after { display: none !important; }
/* The Ultimate matches the skill tiles; on phones the skills share the row evenly. */
.dk-leather .dk-orb { width: 76px !important; height: 76px !important; }
@container dock (max-width: 659px) {
  .dk.dk-leather { grid-template-columns: minmax(0, 1fr) auto !important; column-gap: 8px !important; }
  .dk-leather .dk-abilities .dk-row { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; justify-content: stretch !important; gap: 8px !important; }
  .dk-leather .hot-cell, .dk-leather .hot-slot { width: 100% !important; height: auto !important; aspect-ratio: 1; }
  .dk-leather .dk-orb { width: min(64px, 18cqw) !important; height: min(64px, 18cqw) !important; }
}

/* ---- Ability HUD kit layout ----
   Wide dock: one row (4 skills, 2 smaller locks, 5 supplies, Ultimate) over a slim energy rail.
   Narrower dock: exactly two rows of six, same order. Breakpoint is the dock container, not the viewport. */
.dk.dk-leather { --kit-gap: 6px; --kit-main: clamp(50px, 6cqw, 62px); --kit-small: 46px; max-width: 880px !important; width: min(100%, 880px) !important; padding: 6px 8px !important; gap: 8px 12px !important; }
.dk-leather .dk-abilities .dk-row { grid-template-columns: repeat(4, var(--kit-main)) repeat(2, calc(var(--kit-main) * .8)) !important; gap: var(--kit-gap) !important; align-items: center; justify-content: start !important; }
.dk-leather .dk-abilities .hot-cell:nth-child(n+5) .hot-slot { opacity: .85; }
.dk-leather .dk-abilities .hot-cell:nth-child(n+5) .hot-slot::after { background-image: url("assets/ui/hud/oxblood-slot.webp"); opacity: .7; }
.dk-leather .dk-cell { width: var(--kit-small) !important; height: var(--kit-small) !important; flex-basis: var(--kit-small); }
.dk-leather .dk-bottom, .dk-leather .dk-bottom .dk-row, .dk-leather .dk-bottom .dk-group { gap: var(--kit-gap) !important; }
.dk-leather .dk-orb { width: var(--kit-main) !important; height: var(--kit-main) !important; }
.dk-leather .dk-orb-wrap { grid-area: orb; }

/* Cooldown pill: stopwatch + whole seconds, bottom-right of the skill. Skill cost moves to the top-right. */
.dk-leather .hot-slot .hot-timer {
  position: absolute; grid-area: auto; z-index: 5; right: 4px; bottom: 4px; top: auto; left: auto;
  display: inline-flex; align-items: center; gap: 2px; min-width: 24px; height: 17px; padding: 0 5px 0 3px;
  border: 1px solid #268d73; border-radius: 9px; background: #031d19f5; color: #a6ffe1;
  font: 600 11px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; text-shadow: none; box-shadow: 0 1px 3px #000;
  pointer-events: none;
}
.dk-leather .hot-slot .hot-timer:empty { display: none; }
.dk-leather .hot-slot .hot-timer::before {
  content: ""; width: 10px; height: 10px; flex: none; background: #57e5bd;
  -webkit-mask: url("assets/ui/hud/timer.svg") center / contain no-repeat; mask: url("assets/ui/hud/timer.svg") center / contain no-repeat;
}
.dk-leather .hot-slot .hot-cost { top: 8% !important; bottom: auto !important; right: 8% !important; }

/* Locked skill slots: quiet frame, but the button keeps the full cell as its tap target. */
.dk-leather .hot-slot.is-locked { background: none !important; overflow: visible !important; }
.dk-leather .hot-slot.is-locked::after { inset: 10%; opacity: .55; }
.dk-leather .hot-slot.is-locked .hot-icon { inset: 28% !important; }

/* Two rows of six on narrower docks. The rows share six equal columns so slots line up. */
@container dock (max-width: 799px) {
  .dk.dk-leather { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; grid-template-areas: none !important; align-items: center !important; gap: 5px 4px !important; padding: 5px 6px !important; border-width: 6px !important; border-image-width: 6px !important; }
  .dk-leather .dk-top, .dk-leather .dk-bottom, .dk-leather .dk-abilities, .dk-leather .dk-abilities .dk-row,
  .dk-leather .dk-bottom .dk-group, .dk-leather .dk-bottom .dk-row { display: contents !important; }
  .dk-leather .dk-bottom { border: 0 !important; padding: 0 !important; }
  .dk-leather .dk-abilities > .dk-label { position: absolute !important; }
  .dk-leather .dk-orb-wrap { grid-area: auto; width: 100% !important; display: grid !important; place-items: center; border: 0 !important; padding: 0 !important; box-sizing: border-box; }
  .dk-leather .dk-energy { grid-area: auto; grid-column: 1 / -1; }
  .dk-leather .hot-cell { display: grid; place-items: center; width: 100% !important; }
  .dk-leather .hot-slot { width: min(100%, 50px) !important; }
  .dk-leather .hot-cell:nth-child(n+5) .hot-slot { width: min(100%, 50px) !important; }
  .dk-leather .dk-cell { width: min(100%, 48px) !important; height: auto !important; aspect-ratio: 1; flex: none; justify-self: center; }
  .dk-leather .dk-orb { width: min(100%, 48px) !important; height: auto !important; aspect-ratio: 1; }
  .dk-leather .hot-slot.is-locked { width: min(100%, 50px) !important; height: auto !important; }
}
@media (prefers-reduced-motion: reduce) { .dk-leather .hot-slot .hot-timer { transition: none; } }
