@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@600;700;800&family=Rajdhani:wght@500;600;700&display=swap');

:root {
  color-scheme: only light;
  --ink: #f1efe5;
  --ink-dim: #c8c0aa;
  --panel-bg: rgba(20, 18, 16, 0.68);
  --panel-bg-strong: rgba(24, 20, 17, 0.86);
  --panel-border: rgba(207, 173, 122, 0.45);
  --metal-a: #c7a674;
  --metal-b: #8b6a42;
  --parchment: #e6d4b0;
  --accent-a: #7ed1ff;
  --accent-b: #ffb37a;
  --accent-c: #9bf0cf;
  --danger: #ff7f7f;
  --radius: 14px;
  --blur: 8px;
  --shadow-lg: 0 18px 50px rgba(2, 6, 16, 0.45);
  --shadow-sm: 0 6px 18px rgba(2, 6, 16, 0.35);
  --ui-text-xs: 11px;
  --ui-text-sm: 13px;
  --ui-text-md: 15px;
  --ui-text-lg: 18px;
  font-family: "Rajdhani", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, #97bbf1 0%, transparent 38%),
    radial-gradient(circle at 85% 22%, #6ea4d8 0%, transparent 34%),
    linear-gradient(160deg, #1f3656 0%, #12233c 48%, #0a1321 100%);
}

canvas {
  display: block;
}

#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 18%, rgba(120, 186, 255, 0.18), transparent 42%),
    radial-gradient(circle at 78% 16%, rgba(255, 183, 122, 0.14), transparent 36%),
    linear-gradient(165deg, #0b1220 0%, #0f1a30 52%, #17120f 100%);
  transition: opacity 460ms ease, visibility 460ms ease;
}

#loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.load-card {
  width: min(540px, calc(100vw - 44px));
  padding: 26px 26px 22px;
  border-radius: 16px;
  border: 1px solid rgba(209, 174, 124, 0.5);
  background:
    radial-gradient(circle at 10% 0%, rgba(221, 180, 120, 0.12), transparent 44%),
    linear-gradient(180deg, rgba(24, 19, 15, 0.9), rgba(14, 11, 9, 0.93));
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 236, 204, 0.07);
}

.load-kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.25px;
  color: #d1bc98;
}

.load-title {
  margin-top: 6px;
  font-family: "Orbitron", "Rajdhani", sans-serif;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1;
  color: #f5dfbb;
  text-shadow: 0 2px 10px rgba(255, 202, 136, 0.2);
}

.load-sub {
  margin-top: 12px;
  font-size: 14px;
  color: #a8bfd9;
  min-height: 20px;
}

.load-progress {
  margin-top: 14px;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(176, 151, 112, 0.42);
  background: rgba(6, 12, 21, 0.85);
  overflow: hidden;
}

.load-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, #5ab6ff 0%, #8cdeff 36%, #ffd29b 100%);
  box-shadow: 0 0 16px rgba(117, 194, 255, 0.45);
  transition: width 240ms ease;
}

.load-percent {
  margin-top: 10px;
  font-family: "Orbitron", "Rajdhani", sans-serif;
  font-size: 14px;
  letter-spacing: 0.8px;
  color: #ebd3ad;
  text-align: right;
}

#ui-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background:
    radial-gradient(circle at 50% 40%, rgba(16, 28, 48, 0.22), rgba(9, 14, 24, 0.52)),
    linear-gradient(180deg, rgba(6, 9, 14, 0.32), rgba(6, 9, 14, 0.58));
  backdrop-filter: blur(2px);
}

#ui-ornaments {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(22px);
  opacity: 0.5;
}

.orb-a {
  width: 230px;
  height: 230px;
  left: -60px;
  top: -40px;
  background: radial-gradient(circle, rgba(126, 209, 255, 0.62), rgba(126, 209, 255, 0));
}

.orb-b {
  width: 290px;
  height: 290px;
  right: -90px;
  top: 180px;
  background: radial-gradient(circle, rgba(255, 179, 122, 0.5), rgba(255, 179, 122, 0));
}

.orb-c {
  width: 250px;
  height: 250px;
  left: 42%;
  bottom: -110px;
  background: radial-gradient(circle, rgba(155, 240, 207, 0.35), rgba(155, 240, 207, 0));
}

#hud,
#help,
#minimap,
#objective,
#profile,
.panel,
#target-frame,
#event-overlay {
  position: fixed;
  z-index: 12;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(214, 172, 112, 0.12), transparent 48%),
    linear-gradient(180deg, rgba(28, 24, 20, 0.88), rgba(16, 13, 10, 0.9));
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(255, 242, 219, 0.04), inset 0 1px 0 rgba(255, 216, 157, 0.24);
}

#hud::before,
#objective::before,
#inventory-panel::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 8px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(161, 208, 248, 0.8), transparent);
  pointer-events: none;
}

#hud::after,
#objective::after,
#inventory-panel::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 54px;
  height: 14px;
  border-right: 1px solid rgba(216, 181, 129, 0.5);
  border-bottom: 1px solid rgba(216, 181, 129, 0.5);
  opacity: 0.8;
  pointer-events: none;
}

#hud {
  left: 16px;
  top: 16px;
  width: min(440px, calc(100vw - 32px));
  max-height: min(40vh, 360px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  font-size: var(--ui-text-sm);
  line-height: 1.45;
}

#objective {
  left: 16px;
  top: calc(16px + min(40vh, 360px) + 10px);
  width: min(440px, calc(100vw - 32px));
  max-height: min(43vh, 390px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  font-size: var(--ui-text-sm);
  line-height: 1.44;
}

#profile {
  right: 16px;
  top: 210px;
  width: 220px;
  padding: 8px 10px;
  font-size: 11px;
  font-family: "Lucida Console", Monaco, monospace;
  white-space: pre-line;
  display: none;
}

#minimap {
  right: 16px;
  top: 16px;
  width: 188px;
  height: 188px;
  padding: 4px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

#help {
  right: 16px;
  bottom: 14px;
  width: min(360px, calc(100vw - 32px));
  max-height: min(35vh, 264px);
  overflow: hidden;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--ink-dim);
}

#help.hidden {
  display: none !important;
}

#help h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  color: #f1d8af;
}

#help .help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

#help .help-item {
  border: 1px solid rgba(192, 159, 111, 0.26);
  border-radius: 8px;
  padding: 6px 7px;
  background: rgba(27, 19, 14, 0.5);
  line-height: 1.3;
  font-size: 11px;
  color: #dfccb0;
}

#help .help-item strong {
  color: #f3dfbf;
}

#help kbd {
  font-family: "Lucida Console", Monaco, monospace;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid rgba(202, 166, 113, 0.5);
  border-bottom-color: rgba(169, 133, 85, 0.72);
  border-radius: 6px;
  padding: 1px 5px;
  color: #ffe2bb;
  background: rgba(45, 30, 20, 0.88);
}

#hotbar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 14;
  padding: 8px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(214, 166, 101, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(27, 20, 15, 0.88), rgba(16, 11, 8, 0.9));
  border: 1px solid rgba(198, 163, 113, 0.44);
  box-shadow: var(--shadow-lg);
}

.slot {
  position: relative;
  --cd: 0;
  width: 92px;
  height: 78px;
  border: 1px solid rgba(197, 164, 117, 0.58);
  border-radius: 12px;
  background:
    radial-gradient(circle at 70% 20%, rgba(255, 213, 148, 0.22), transparent 54%),
    linear-gradient(180deg, rgba(40, 30, 22, 0.95), rgba(20, 14, 10, 0.96));
  overflow: hidden;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.slot:hover {
  transform: translateY(-1px);
  border-color: rgba(229, 194, 144, 0.72);
}

.slot::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(202, 172, 126, 0.22);
  border-radius: 9px;
  pointer-events: none;
}

.slot::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(15, 11, 8, 0.95) 42%, transparent 45%),
    conic-gradient(from -90deg, rgba(255, 198, 122, 0.86) calc((1 - var(--cd)) * 360deg), rgba(55, 40, 24, 0.45) 0);
  border: 1px solid rgba(205, 168, 117, 0.38);
  box-shadow: 0 0 8px rgba(255, 194, 120, 0.18);
  pointer-events: none;
}

.slot-key {
  position: absolute;
  top: 5px;
  left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #ffddb3;
  opacity: 0.92;
}

.slot-name {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 22px;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #e9deca;
}

.slot-timer {
  position: absolute;
  right: 7px;
  bottom: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.35px;
  color: #ffe0b3;
  text-shadow: 0 0 6px rgba(255, 186, 98, 0.28);
  background: rgba(14, 9, 7, 0.72);
  border: 1px solid rgba(202, 166, 113, 0.32);
  border-radius: 999px;
  padding: 1px 5px;
  line-height: 1.1;
}

.slot.locked .slot-timer {
  color: #ffb8a2;
  border-color: rgba(255, 137, 112, 0.4);
}

.slot-cooldown {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: linear-gradient(180deg, rgba(9, 6, 5, 0.74), rgba(9, 6, 5, 0.48));
  transition: height 60ms linear;
}

.slot.ready {
  box-shadow: 0 0 0 1px rgba(238, 198, 131, 0.44), 0 0 20px rgba(238, 182, 96, 0.25);
}

.slot.proc {
  animation: slotReadyPulse 0.72s ease-out 1;
}

.slot.proc::before {
  border-color: rgba(255, 212, 140, 0.58);
}

.slot.locked {
  filter: saturate(0.35) brightness(0.74);
}

@keyframes slotReadyPulse {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(255, 206, 132, 0);
  }
  34% {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 0 1px rgba(255, 214, 152, 0.75), 0 0 28px rgba(255, 186, 95, 0.4);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 1px rgba(238, 198, 131, 0.35), 0 0 16px rgba(238, 182, 96, 0.2);
  }
}

#target-frame {
  left: 50%;
  bottom: 114px;
  transform: translateX(-50%);
  width: min(430px, calc(100vw - 24px));
  padding: 10px 12px 11px;
  z-index: 15;
  background: linear-gradient(180deg, rgba(14, 25, 43, 0.88), rgba(7, 13, 25, 0.88));
  transition: box-shadow 120ms ease, border-color 120ms ease;
}

#target-frame.warn {
  border-color: rgba(255, 183, 122, 0.72);
  box-shadow: 0 10px 28px rgba(255, 166, 96, 0.2), var(--shadow-sm);
}

#target-frame.urgent {
  border-color: rgba(255, 130, 110, 0.85);
  box-shadow: 0 12px 32px rgba(255, 120, 98, 0.32), var(--shadow-sm);
  animation: targetUrgentPulse 0.52s ease-in-out infinite alternate;
}

@keyframes targetUrgentPulse {
  from {
    filter: brightness(1);
  }
  to {
    filter: brightness(1.08);
  }
}

.tf-name {
  font-size: var(--ui-text-lg);
  font-weight: 700;
  letter-spacing: 0.35px;
}

.tf-sub {
  margin-top: 4px;
  font-size: var(--ui-text-sm);
  color: var(--ink-dim);
  line-height: 1.28;
  min-height: 34px;
}

.tf-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tf-tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(155, 191, 228, 0.35);
  background: rgba(18, 31, 51, 0.72);
  color: #d6e7fa;
  white-space: nowrap;
}

.tf-tag.hp {
  border-color: rgba(137, 224, 166, 0.38);
  color: #cbf2d8;
}

.tf-tag.warn {
  border-color: rgba(255, 182, 110, 0.5);
  color: #ffd4a4;
}

.tf-tag.urgent {
  border-color: rgba(255, 126, 110, 0.72);
  color: #ffd3cb;
  box-shadow: 0 0 10px rgba(255, 114, 90, 0.24);
}

.tf-bar,
.tf-cast {
  margin-top: 8px;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
}

.tf-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #92f89f, #33c95f);
}

.tf-cast {
  height: 6px;
  margin-top: 6px;
  opacity: 0;
}

.tf-cast-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d0a0ff, #9459ff);
}

#crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 13;
  color: rgba(245, 251, 255, 0.8);
  text-shadow: 0 0 12px rgba(126, 209, 255, 0.35);
  font-size: 20px;
  font-weight: bold;
  pointer-events: none;
}

#screen-fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 18;
  opacity: 0;
  transition: opacity 50ms linear;
}

#damage-indicators {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 196px;
  height: 196px;
  transform: translate(-50%, -50%);
  z-index: 19;
  pointer-events: none;
}

.hit {
  position: absolute;
  width: 32px;
  height: 32px;
  opacity: 0;
  filter: drop-shadow(0 0 7px rgba(255, 92, 92, 0.58));
}

.hit::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 16px solid rgba(255, 116, 116, 0.92);
}

.hit.front {
  left: 82px;
  top: 6px;
}

.hit.right {
  right: 6px;
  top: 82px;
  transform: rotate(90deg);
}

.hit.back {
  left: 82px;
  bottom: 6px;
  transform: rotate(180deg);
}

.hit.left {
  left: 6px;
  top: 82px;
  transform: rotate(-90deg);
}

.panel {
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  width: min(430px, calc(100vw - 24px));
  max-height: min(78vh, 760px);
  overflow: auto;
  padding: 14px;
  z-index: 40;
  background:
    radial-gradient(circle at 0% 0%, rgba(214, 168, 105, 0.15), transparent 44%),
    linear-gradient(180deg, rgba(31, 24, 18, 0.95), rgba(16, 12, 9, 0.96));
  box-shadow: var(--shadow-lg);
}

.panel h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
  letter-spacing: 0.45px;
  color: var(--parchment);
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 2px 0 8px;
  background: linear-gradient(180deg, rgba(31, 24, 18, 0.98), rgba(31, 24, 18, 0.75));
}

.panel label {
  display: block;
  font-size: 11px;
  margin: 7px 0;
  color: #cfba97;
  letter-spacing: 0.2px;
}

.panel input[type="text"],
.panel select {
  width: 100%;
  margin-top: 4px;
  background: #251b14;
  color: #f1e4ce;
  border: 1px solid #715531;
  border-radius: 7px;
  padding: 5px 7px;
}

.panel button {
  margin-top: 10px;
  width: 100%;
  background: linear-gradient(90deg, #74512e, #9b7140);
  color: #fff0da;
  border: 1px solid #bc8c56;
  border-radius: 8px;
  padding: 7px 9px;
  cursor: pointer;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.settings-card {
  border: 1px solid rgba(193, 160, 113, 0.26);
  border-radius: 10px;
  padding: 8px;
  background: rgba(25, 18, 13, 0.58);
}

.settings-card h4 {
  margin: 0 0 6px 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: #e5c997;
}

.settings-card label {
  margin: 5px 0;
}

#settings::-webkit-scrollbar,
#inventory-panel::-webkit-scrollbar,
.panel::-webkit-scrollbar {
  width: 8px;
}

#settings::-webkit-scrollbar-thumb,
#inventory-panel::-webkit-scrollbar-thumb,
.panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(205, 167, 114, 0.85), rgba(148, 112, 67, 0.9));
  border-radius: 999px;
}

#inventory-panel {
  left: auto;
  right: 16px;
  transform: none;
  top: 16px;
  width: min(500px, calc(100vw - 24px));
  max-height: min(76vh, 820px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 41;
}

#inventory-panel h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0.4px;
}

.inv-tabs {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.inv-tab {
  margin-top: 0 !important;
  border: 1px solid rgba(196, 161, 112, 0.36);
  border-radius: 10px !important;
  background: linear-gradient(180deg, rgba(44, 28, 19, 0.9), rgba(26, 17, 12, 0.9)) !important;
  color: #d9c19b !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.35px;
  padding: 8px 6px !important;
  cursor: pointer;
  transition: border-color 130ms ease, transform 130ms ease, box-shadow 130ms ease;
}

.inv-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(223, 185, 127, 0.62);
}

.inv-tab.active {
  border-color: rgba(240, 196, 127, 0.72);
  color: #ffddae !important;
  box-shadow: inset 0 0 0 1px rgba(255, 214, 147, 0.24), 0 0 18px rgba(255, 180, 101, 0.16);
}

.inv-pane {
  margin-top: 8px;
  display: none;
}

.inv-pane.active {
  display: block;
  max-height: min(56vh, 540px);
  overflow: auto;
  padding-right: 3px;
}

.inv-pane.active::-webkit-scrollbar {
  width: 8px;
}

.inv-pane.active::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(205, 167, 114, 0.85), rgba(148, 112, 67, 0.9));
  border-radius: 999px;
}

.inv-meta {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inv-meta-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.inv-stat-card {
  border: 1px solid rgba(188, 155, 111, 0.34);
  border-radius: 10px;
  padding: 6px 7px;
  background: rgba(24, 17, 12, 0.66);
  min-height: 56px;
}

.inv-stat-card span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #bea784;
}

.inv-stat-card strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  color: #f7e4c1;
  line-height: 1.2;
}

.inv-stat-card em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 11px;
  color: #dfc499;
}

.inv-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.inv-section {
  margin-top: 8px;
  border: 1px solid rgba(190, 156, 110, 0.25);
  border-radius: 10px;
  padding: 8px;
  background: rgba(24, 17, 12, 0.66);
}

.inv-section h4 {
  margin: 0 0 6px 0;
  font-size: 12px;
  color: #c9b089;
  text-transform: uppercase;
  letter-spacing: 0.45px;
}

.inv-item-name {
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  color: #f1e3c9;
  display: block;
}

.inv-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.inv-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inv-item-card {
  border: 1px solid rgba(189, 157, 109, 0.24);
  border-radius: 11px;
  padding: 9px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 205, 137, 0.06), transparent 36%),
    linear-gradient(180deg, rgba(21, 17, 14, 0.82), rgba(14, 11, 9, 0.9));
}

.inv-item-card.common {
  box-shadow: inset 0 0 0 1px rgba(205, 188, 160, 0.04);
}

.inv-item-card.rare {
  border-color: rgba(112, 166, 228, 0.45);
  box-shadow: inset 0 0 0 1px rgba(138, 186, 241, 0.14), 0 0 16px rgba(82, 139, 215, 0.12);
}

.inv-item-card.epic {
  border-color: rgba(173, 126, 230, 0.55);
  box-shadow: inset 0 0 0 1px rgba(196, 148, 244, 0.15), 0 0 18px rgba(153, 95, 228, 0.14);
}

.inv-item-card.legendary {
  border-color: rgba(243, 188, 113, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 221, 169, 0.2), 0 0 20px rgba(248, 177, 82, 0.18);
}

.inv-item-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0;
}

.inv-item-card.rare::after {
  background: linear-gradient(125deg, transparent 0%, rgba(159, 211, 255, 0.24) 48%, transparent 72%);
  animation: invRareSweep 5.2s ease-in-out infinite;
}

.inv-item-card.epic::after {
  background: linear-gradient(130deg, transparent 0%, rgba(210, 163, 255, 0.24) 52%, transparent 74%);
  animation: invRareSweep 4.8s ease-in-out infinite;
}

.inv-item-card.legendary::after {
  background: linear-gradient(132deg, transparent 0%, rgba(255, 220, 158, 0.29) 52%, transparent 76%);
  animation: invLegendarySweep 4.2s ease-in-out infinite;
}

@keyframes invRareSweep {
  0%, 70%, 100% { opacity: 0; transform: translateX(-22%); }
  34% { opacity: 0.4; transform: translateX(6%); }
}

@keyframes invLegendarySweep {
  0%, 64%, 100% { opacity: 0; transform: translateX(-18%); }
  30% { opacity: 0.52; transform: translateX(8%); }
}

.inv-slot-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(214, 186, 144, 0.35);
  background: rgba(35, 25, 16, 0.75);
  position: relative;
  flex: 0 0 18px;
}

.inv-slot-icon.weapon::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 11px;
  left: 8px;
  top: 3px;
  background: #e8c58f;
  transform: rotate(24deg);
  border-radius: 2px;
}

.inv-slot-icon.armor::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 10px;
  left: 4px;
  top: 3px;
  border: 1px solid #8eb8e4;
  border-radius: 3px 3px 5px 5px;
}

.inv-rarity-pill {
  font-size: 9px;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(184, 152, 107, 0.45);
  color: #d9bf95;
  background: rgba(35, 24, 16, 0.7);
  white-space: nowrap;
}

.inv-rarity-pill.rare {
  border-color: rgba(129, 185, 244, 0.6);
  color: #b8dcff;
}

.inv-rarity-pill.epic {
  border-color: rgba(190, 147, 250, 0.65);
  color: #dec3ff;
}

.inv-rarity-pill.legendary {
  border-color: rgba(255, 205, 129, 0.66);
  color: #ffdfaf;
}

.inv-item-sub {
  margin-top: 2px;
  font-size: 13px;
  color: #bea885;
}

.inv-item-metrics {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.inv-item-body {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  align-items: start;
}

.inv-item-main {
  min-width: 0;
}

.inv-item-art {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 1px solid rgba(189, 157, 109, 0.3);
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 214, 150, 0.19), transparent 42%),
    linear-gradient(170deg, rgba(28, 23, 18, 0.95), rgba(17, 14, 11, 0.9));
  position: relative;
}

.inv-item-art span {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
}

.inv-item-art.weapon.blade span:first-child {
  width: 5px;
  height: 28px;
  background: linear-gradient(180deg, #ffe4b0, #caa26f);
  transform: translate(-50%, -62%) rotate(24deg);
  border-radius: 2px;
}

.inv-item-art.weapon.blade span:last-child {
  width: 14px;
  height: 4px;
  background: #8b6b43;
  transform: translate(-50%, 8px) rotate(24deg);
  border-radius: 999px;
}

.inv-item-art.weapon.polearm span:first-child {
  width: 3px;
  height: 32px;
  background: #9b7a51;
  transform: translate(-50%, -50%) rotate(22deg);
  border-radius: 2px;
}

.inv-item-art.weapon.polearm span:last-child {
  width: 10px;
  height: 8px;
  background: #d9c7a5;
  clip-path: polygon(0 100%, 100% 50%, 0 0);
  transform: translate(3px, -15px) rotate(22deg);
}

.inv-item-art.weapon.heavy span:first-child {
  width: 5px;
  height: 22px;
  background: #b0875a;
  transform: translate(-50%, -6px);
  border-radius: 3px;
}

.inv-item-art.weapon.heavy span:last-child {
  width: 20px;
  height: 14px;
  background: linear-gradient(180deg, #cfbd9f, #91806d);
  transform: translate(-50%, -18px);
  border-radius: 4px;
}

.inv-item-art.weapon.focus span:first-child {
  width: 3px;
  height: 30px;
  background: #8f734f;
  transform: translate(-50%, -50%);
  border-radius: 2px;
}

.inv-item-art.weapon.focus span:last-child {
  width: 15px;
  height: 15px;
  background: radial-gradient(circle at 30% 30%, #d5efff, #6eaadf 70%);
  transform: translate(-50%, -19px);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(122, 187, 246, 0.35);
}

.inv-item-art.armor.plate span:first-child {
  width: 22px;
  height: 26px;
  border-radius: 7px 7px 10px 10px;
  border: 2px solid #9eb6cd;
  background: linear-gradient(180deg, rgba(178, 198, 218, 0.28), rgba(93, 114, 138, 0.28));
  transform: translate(-50%, -56%);
}

.inv-item-art.armor.plate span:last-child {
  width: 15px;
  height: 5px;
  border-radius: 999px;
  border: 1px solid #f3c87e;
  transform: translate(-50%, 6px);
}

.inv-item-art.armor.robe span:first-child {
  width: 20px;
  height: 28px;
  background: linear-gradient(180deg, rgba(111, 166, 226, 0.45), rgba(69, 95, 139, 0.4));
  clip-path: polygon(18% 0, 82% 0, 100% 86%, 50% 100%, 0 86%);
  transform: translate(-50%, -56%);
}

.inv-item-art.armor.robe span:last-child {
  width: 14px;
  height: 4px;
  border-radius: 999px;
  background: #c8daf0;
  transform: translate(-50%, -13px);
}

.inv-item-art.armor.leather span:first-child {
  width: 22px;
  height: 25px;
  border-radius: 8px;
  border: 2px solid #a2845f;
  background: linear-gradient(180deg, rgba(168, 131, 88, 0.35), rgba(84, 57, 31, 0.5));
  transform: translate(-50%, -56%);
}

.inv-item-art.armor.leather span:last-child {
  width: 16px;
  height: 4px;
  border-radius: 999px;
  background: #dcb27d;
  transform: translate(-50%, -2px);
}

.inv-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(147, 180, 214, 0.38);
  background: rgba(18, 30, 44, 0.65);
  color: #ddecff;
}

.inv-affix-list {
  margin-top: 8px;
  display: grid;
  gap: 4px;
}

.inv-affix-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 7px;
  border: 1px solid rgba(141, 120, 91, 0.26);
  background: rgba(33, 24, 17, 0.62);
  font-size: 12px;
}

.inv-affix-line span {
  color: #cdb290;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-affix-line strong {
  color: #f3d1a0;
  font-weight: 700;
}

.inv-affix-more {
  font-size: 11px;
  color: #b89f7c;
  padding: 2px 4px 0;
}

.inv-tags {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.inv-tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(175, 145, 105, 0.32);
  background: rgba(34, 24, 17, 0.63);
  color: #e0cdb0;
}

.inv-tag.active {
  border-color: rgba(255, 190, 126, 0.56);
  background: rgba(48, 27, 15, 0.58);
  color: #ffd9b3;
}

.inv-empty {
  font-size: 12px;
  color: #b59e7a;
}

.inv-recent-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(147, 183, 215, 0.16);
  border-radius: 8px;
  background: rgba(16, 25, 39, 0.34);
  font-size: 12px;
  margin-bottom: 5px;
}

.inv-recent-item:last-child {
  margin-bottom: 0;
}

.inv-recent-item span {
  color: #f0dec0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-recent-item strong {
  color: #ffd4a3;
  font-size: 11px;
  text-transform: uppercase;
}

.inv-item-name.common,
.inv-recent-item.common strong,
.inv-tag.common {
  color: #e2ceb0;
}

.inv-item-name.rare,
.inv-recent-item.rare strong,
.inv-tag.rare {
  color: #8dc5ff;
}

.inv-item-name.epic,
.inv-recent-item.epic strong,
.inv-tag.epic {
  color: #d4a8ff;
}

.inv-item-name.legendary,
.inv-recent-item.legendary strong,
.inv-tag.legendary {
  color: #ffc980;
}

.inv-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.inv-compare-card {
  min-height: 186px;
}

.inv-compare-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #cfb18a;
}

.inv-compare-delta {
  margin-top: 8px;
  border-radius: 9px;
  border: 1px solid rgba(188, 154, 108, 0.34);
  background: rgba(32, 24, 16, 0.72);
  padding: 8px 9px;
  font-size: 12px;
  font-weight: 700;
  color: #d8c0a0;
  text-align: center;
  letter-spacing: 0.2px;
}

.inv-compare-delta.good {
  border-color: rgba(125, 225, 161, 0.5);
  background: rgba(21, 51, 34, 0.72);
  color: #c3ffd5;
}

.inv-compare-delta.bad {
  border-color: rgba(235, 136, 126, 0.5);
  background: rgba(60, 22, 20, 0.72);
  color: #ffc4b8;
}

.inv-compare-delta.flat {
  border-color: rgba(155, 185, 214, 0.45);
  background: rgba(20, 31, 46, 0.72);
  color: #d4e8ff;
}

.inv-empty.compare {
  padding: 8px 4px 2px;
}

.inv-actions {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.inv-lanes {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
}

.inv-lanes button {
  margin-top: 0;
  font-size: 12px;
  padding: 9px 6px;
  background: linear-gradient(180deg, rgba(54, 37, 24, 0.94), rgba(31, 21, 14, 0.94));
}

.inv-lanes button.active {
  border-color: rgba(255, 194, 121, 0.86);
  box-shadow: 0 0 0 1px rgba(255, 190, 113, 0.4), 0 0 18px rgba(255, 162, 82, 0.22);
  color: #ffe2be;
}

.inv-footer {
  margin-top: 8px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-top: 8px;
  background: linear-gradient(180deg, rgba(16, 12, 9, 0.08), rgba(16, 12, 9, 0.96));
}

#event-overlay {
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 44;
  min-width: 320px;
  max-width: min(92vw, 580px);
  text-align: center;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: var(--shadow-lg);
}

.evt-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.45px;
  color: #ffe3ba;
}

.evt-sub {
  margin-top: 4px;
  font-size: 13px;
  color: #e8d4b4;
}

.evt-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.evt-cell {
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid rgba(194, 162, 115, 0.32);
  background: rgba(24, 17, 12, 0.68);
}

.evt-cell span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.42px;
  color: #c4ac86;
}

.evt-cell strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: #f7e4c3;
}

.hidden {
  display: none !important;
}

body.ui-panel-open #hud,
body.ui-panel-open #objective,
body.ui-panel-open #target-frame,
body.ui-panel-open #hotbar,
body.ui-panel-open #minimap,
body.ui-panel-open #help {
  opacity: 0.38;
  filter: saturate(0.65);
  transition: opacity 110ms ease, filter 110ms ease;
}

body.ui-panel-open #settings,
body.ui-panel-open #inventory-panel {
  opacity: 1;
  filter: none;
}

body.minimal-hud #objective,
body.minimal-hud #help,
body.minimal-hud #profile {
  display: none !important;
}

body.minimal-hud #hud {
  width: min(360px, calc(100vw - 26px));
  max-height: min(30vh, 220px);
}

body.minimal-hud #minimap {
  opacity: 0.58;
}

body.minimal-hud #hud .hud-kpis,
body.minimal-hud #hud .hud-contract,
body.minimal-hud #hud .hud-status {
  display: none;
}

body.minimal-hud #hud .hud-subline {
  margin-top: 2px;
  font-size: 12px;
}

body.minimal-hud #hud .hud-action-strip {
  margin-top: 8px;
}

body.minimal-hud:not(.combat-ui) #target-frame {
  opacity: 0.55;
}

.stat-bar {
  margin-top: 3px;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  background: linear-gradient(90deg, #8ed8ff, #39a0f1);
}

.hud-title,
.obj-title {
  font-family: "Orbitron", "Rajdhani", sans-serif;
  font-size: var(--ui-text-md);
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: #f3dcb6;
  font-weight: 700;
}

.hud-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.hud-pill {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(192, 159, 111, 0.5);
  background: rgba(35, 24, 16, 0.74);
  color: #ead2a9;
}

.hud-pill.good {
  border-color: rgba(145, 241, 178, 0.45);
  color: #baf4ce;
}

.hud-pill.mid {
  border-color: rgba(255, 212, 149, 0.5);
  color: #ffe0ac;
}

.hud-pill.warn {
  border-color: rgba(255, 151, 151, 0.52);
  color: #ffbbbb;
}

.hud-sub {
  margin-top: 3px;
  color: #ccb894;
  font-size: 11px;
}

.hud-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.hud-chip {
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(200, 166, 116, 0.42);
  background: rgba(28, 20, 14, 0.68);
  color: #e7d1ac;
}

.hud-vitals {
  margin-top: 10px;
  display: grid;
  gap: 7px;
}

.hud-contract {
  margin-top: 9px;
  padding: 7px;
  border-radius: 9px;
  border: 1px solid rgba(194, 162, 115, 0.28);
  background: rgba(30, 21, 15, 0.66);
}

.hud-contract-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  color: #e7d3b2;
}

.hud-contract-sub {
  margin-top: 5px;
  font-size: 11px;
  color: #ccb28a;
}

.hud-vital-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #e5d4b7;
  margin-bottom: 3px;
}

.hud-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.hud-cell {
  padding: 6px 7px;
  border-radius: 9px;
  border: 1px solid rgba(194, 162, 115, 0.25);
  background: rgba(26, 19, 14, 0.62);
}

.hud-cell span {
  display: block;
  font-size: 10px;
  color: #baa57f;
}

.hud-cell strong {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #f0e0c1;
  font-weight: 600;
  white-space: normal;
  line-height: 1.28;
  max-height: 32px;
  overflow: hidden;
}

.hud-status {
  margin-top: 9px;
  padding: 7px 8px;
  border-left: 3px solid rgba(214, 172, 112, 0.7);
  background: rgba(24, 17, 12, 0.74);
  border-radius: 8px;
  font-size: 14px;
  color: #f2e2c6;
  line-height: 1.32;
  min-height: 38px;
  max-height: 56px;
  overflow: hidden;
}

.obj-main {
  margin-top: 8px;
  display: grid;
  gap: 7px;
}

.obj-ribbon {
  margin-top: 8px;
  display: grid;
  gap: 4px;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid rgba(239, 182, 118, 0.55);
  background:
    radial-gradient(circle at 85% 10%, rgba(255, 195, 123, 0.16), transparent 46%),
    linear-gradient(180deg, rgba(43, 26, 16, 0.84), rgba(26, 17, 11, 0.84));
}

.obj-ribbon strong {
  font-size: 10px;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  color: #f4ca93;
}

.obj-ribbon span {
  font-size: 11px;
  color: #f3dfc1;
  line-height: 1.35;
}

.obj-ribbon-danger {
  border-color: rgba(255, 139, 118, 0.65);
  background:
    radial-gradient(circle at 86% 14%, rgba(255, 135, 108, 0.2), transparent 50%),
    linear-gradient(180deg, rgba(48, 24, 17, 0.9), rgba(30, 14, 11, 0.9));
}

.obj-ribbon-danger strong {
  color: #ffc4ad;
}

.obj-ribbon-danger span {
  color: #ffe6dc;
}

.obj-ribbon-danger.urgent {
  animation: threatPulse 0.58s ease-in-out infinite alternate;
}

@keyframes threatPulse {
  from {
    box-shadow: inset 0 0 0 1px rgba(255, 140, 122, 0.2), 0 0 8px rgba(255, 128, 104, 0.18);
  }
  to {
    box-shadow: inset 0 0 0 1px rgba(255, 166, 126, 0.42), 0 0 16px rgba(255, 128, 104, 0.33);
  }
}

.obj-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.obj-mode {
  font-size: 11px;
  border: 1px solid rgba(181, 150, 108, 0.35);
  border-radius: 999px;
  padding: 2px 7px;
  color: #c7b190;
  background: rgba(27, 19, 14, 0.55);
}

.obj-mode.compact {
  border-color: rgba(223, 179, 117, 0.5);
  color: #eed5ab;
}

.obj-item {
  padding: 7px 8px;
  border: 1px solid rgba(196, 161, 112, 0.3);
  border-radius: 9px;
  background: rgba(25, 18, 13, 0.62);
}

.obj-track {
  position: relative;
  padding-bottom: 10px;
}

.obj-contracts {
  margin-top: 8px;
  display: grid;
  gap: 7px;
}

.obj-contract.active {
  border-color: rgba(225, 185, 124, 0.55);
  box-shadow: inset 0 0 0 1px rgba(243, 203, 143, 0.2);
}

.obj-progress {
  margin-top: 6px;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 233, 199, 0.12);
  overflow: hidden;
}

.obj-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d9b584, #b48d58);
}

.obj-progress-fill.alt {
  background: linear-gradient(90deg, #ffcd89, #ff946f);
}

.obj-label {
  font-size: 11px;
  color: #bca27a;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.obj-text {
  margin-top: 3px;
  font-size: 14px;
  color: #efe0c3;
}

.obj-meta {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: #f7d7a4;
}

.obj-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.obj-cell {
  padding: 6px 7px;
  border-radius: 9px;
  border: 1px solid rgba(189, 156, 112, 0.22);
  background: rgba(24, 17, 12, 0.66);
}

.obj-cell span {
  display: block;
  font-size: 11px;
  color: #b9a17b;
}

.obj-cell strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: #efe1c5;
  font-weight: 600;
  line-height: 1.3;
  max-height: 34px;
  overflow: hidden;
}

#objective.compact-mode .obj-grid {
  grid-template-columns: 1fr 1fr;
}

#objective.compact-mode .obj-grid .obj-cell:nth-child(n + 5) {
  display: block;
}

#objective.compact-mode .obj-contract:not(.active):not(:first-child) {
  display: block;
}

.uicon-svg {
  width: 11px;
  height: 11px;
  margin-right: 5px;
  vertical-align: -1px;
  stroke: #e0bf8e;
  stroke-width: 1.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.92;
}

.hud-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.hud-title-main {
  font-family: "Orbitron", "Rajdhani", sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.7px;
  color: #f6deb5;
}

.hud-subline {
  margin-top: 4px;
  font-size: 14px;
  color: #ddc9a8;
}

.hud-vitals-main .hud-vital-top {
  font-size: 13px;
  font-weight: 600;
}

.hud-vitals-main .stat-bar {
  height: 8px;
}

.hud-action-strip {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.hud-action {
  border: 1px solid rgba(194, 162, 115, 0.35);
  border-radius: 9px;
  padding: 7px 8px;
  background: rgba(21, 17, 15, 0.74);
}

.hud-action span {
  display: block;
  font-size: 10px;
  color: #bca27a;
  text-transform: uppercase;
  letter-spacing: 0.45px;
}

.hud-action strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: #fce4bd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-kpis {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.hud-kpi {
  border: 1px solid rgba(194, 162, 115, 0.3);
  border-radius: 9px;
  padding: 7px 8px;
  background: rgba(26, 19, 14, 0.62);
}

.hud-kpi span {
  display: block;
  font-size: 10px;
  color: #bda782;
  text-transform: uppercase;
  letter-spacing: 0.45px;
}

.hud-kpi strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  color: #f4e4c7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-contract-compact .hud-contract-top {
  font-size: 12px;
}

.hud-status {
  font-size: 13px;
}

.obj-section {
  margin-top: 8px;
  border: 1px solid rgba(196, 161, 112, 0.32);
  border-radius: 10px;
  background: rgba(25, 18, 13, 0.62);
  overflow: hidden;
}

.obj-tabs {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.obj-tab {
  border: 1px solid rgba(196, 161, 112, 0.36);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(44, 28, 19, 0.9), rgba(26, 17, 12, 0.9));
  color: #d9c19b;
  font-size: var(--ui-text-sm);
  font-weight: 700;
  letter-spacing: 0.35px;
  padding: 7px 8px;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.obj-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(223, 185, 127, 0.62);
}

.obj-tab.active {
  border-color: rgba(240, 196, 127, 0.72);
  color: #ffddae;
  box-shadow: inset 0 0 0 1px rgba(255, 214, 147, 0.24), 0 0 18px rgba(255, 180, 101, 0.16);
}

.obj-panel {
  margin-top: 8px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-right: 2px;
}

.obj-panel::-webkit-scrollbar {
  width: 8px;
}

.obj-panel::-webkit-scrollbar-track {
  background: rgba(26, 18, 12, 0.45);
  border-radius: 999px;
}

.obj-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(205, 167, 114, 0.85), rgba(148, 112, 67, 0.9));
  border-radius: 999px;
}

.obj-grid-compact {
  margin: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.obj-item .obj-text {
  font-size: 14px;
  line-height: 1.34;
  max-height: 38px;
  overflow: hidden;
  word-break: break-word;
}

.obj-cell strong {
  word-break: break-word;
}

@media (max-width: 980px) {
  #hud {
    width: calc(100vw - 24px);
    max-height: 33vh;
    font-size: 12px;
  }

  #objective {
    top: calc(16px + 33vh + 8px);
    width: calc(100vw - 24px);
    max-height: 37vh;
    font-size: 12px;
  }

  #minimap {
    width: 150px;
    height: 150px;
    right: 10px;
    top: auto;
    bottom: 108px;
  }

  #profile {
    right: 10px;
    top: auto;
    bottom: 265px;
    width: 170px;
  }

  #help {
    max-height: 22vh;
    padding: 8px;
    font-size: 11px;
  }

  #hotbar {
    bottom: 10px;
    gap: 7px;
    padding: 6px;
  }

  .slot {
    width: 74px;
    height: 64px;
  }

  .slot-name {
    font-size: 9px;
    bottom: 18px;
  }

  .slot-timer {
    right: 4px;
    bottom: 4px;
    font-size: 9px;
    padding: 1px 4px;
  }

  #target-frame {
    width: min(95vw, 380px);
    bottom: 84px;
  }

  .hud-grid,
  .obj-grid {
    grid-template-columns: 1fr;
  }

  .hud-hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .hud-action-strip,
  .hud-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .obj-grid-compact {
    grid-template-columns: 1fr;
  }

  .obj-tabs {
    grid-template-columns: 1fr;
  }

  .obj-panel {
    overflow: auto;
  }

  #help .help-grid {
    grid-template-columns: 1fr;
  }

  #inventory-panel {
    right: 12px;
    left: 12px;
    width: auto;
    max-height: 72vh;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .inv-grid,
  .inv-actions,
  .inv-compare-grid {
    grid-template-columns: 1fr;
  }

  .inv-meta-cards {
    grid-template-columns: 1fr 1fr;
  }

  .inv-pane.active {
    max-height: min(50vh, 500px);
  }

  .evt-grid {
    grid-template-columns: 1fr;
  }
}
