/*
  Note: backdrop-filter draws a black box in FiveM NUI, do not use it.
  Transparency uses rgba colors and gradients only.
*/
:root {
  --text: #f2efe8;
  --muted: rgba(242, 239, 232, 0.62);
  --dim: rgba(242, 239, 232, 0.35);
  --line: rgba(255, 255, 255, 0.12);
  --row: rgba(0, 0, 0, 0.3);
  --row-hover: rgba(0, 0, 0, 0.45);
  --brass: #d6ad55;
  --err: #e0605b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  color: var(--text);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  user-select: none;
}

.hidden { display: none !important; }

/* Keycap */
.cap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom-width: 3px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-shadow: none;
}
.cap.small { min-width: 0; height: 20px; font-size: 10px; letter-spacing: 0.04em; }

/* Key hint */
.cap.big {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 2px 0 0;
  border-width: 1px;
  border-color: rgba(214, 173, 85, 0.75);
  box-shadow: 0 2px 0 rgba(214, 173, 85, 0.45);
  color: var(--brass);
  font-size: 16px;
  text-align: center;
}

/* Same style as the panel: no box, fading shade */
.hint {
  position: fixed;
  left: 50%;
  bottom: 14vh;
  transform: translateX(-50%);
  zoom: 1.15;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 70px;
  background: radial-gradient(ellipse closest-side at center,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(0, 0, 0, 0.6) 55%,
    rgba(0, 0, 0, 0) 100%);
  animation: fade 0.15s ease-out;
}
.hint::before {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  top: 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(214, 173, 85, 0.7), transparent);
}

.hint-body { display: flex; flex-direction: column; gap: 1px; }

.hint-dept {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--brass);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.hint-dept .star { width: 10px; height: 10px; }

.hint-text {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

/* Right side shade that keeps the game visible */
.shade {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 52vw;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.72) 40%, rgba(0, 0, 0, 0) 100%);
  animation: fade 0.2s ease-out;
}

.panel {
  position: fixed;
  top: 50%;
  right: 4vw;
  transform: translateY(-50%);
  width: 460px;
  zoom: 1.15;
  animation: fade 0.2s ease-out;
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.dept {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--brass);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.star { width: 14px; height: 14px; fill: var(--brass); }

.plate {
  padding: 1px 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: "Consolas", "Cascadia Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0 12px;
}

h1 {
  font-size: 26px;
  font-weight: 600;
}

.count {
  color: var(--muted);
  font-family: "Consolas", "Cascadia Mono", monospace;
  font-size: 13px;
}

/* Rack slots: inventory grid */
.slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 104px;
  padding: 6px 8px 7px;
  background: var(--row);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  text-shadow: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
button.tile:hover { background: var(--row-hover); border-color: var(--brass); }

.tile.empty {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  cursor: default;
}

.tile-no {
  position: absolute;
  top: 4px;
  left: 6px;
  color: var(--dim);
  font-family: "Consolas", "Cascadia Mono", monospace;
  font-size: 10px;
}

.tile-pic {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding-top: 8px;
}
.tile-pic img {
  max-width: 100%;
  max-height: 40px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}
.tile-pic svg { width: 100%; height: 30px; fill: #d9d5cb; }
.kind-ammo .tile-pic svg,
.kind-ammo.thumb svg { fill: var(--brass); }

.tile-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-amount {
  margin-top: 1px;
  color: var(--muted);
  font-family: "Consolas", "Cascadia Mono", monospace;
  font-size: 10px;
}

/* "Take" on hover */
.tile-take {
  position: absolute;
  top: 5px;
  right: 6px;
  padding: 1px 7px;
  border: 1px solid var(--brass);
  border-radius: 2px;
  color: var(--brass);
  font-size: 10px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.12s;
}
button.tile:hover .tile-take { opacity: 1; }

.info { min-width: 0; }
.name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: "Consolas", "Cascadia Mono", monospace;
  font-size: 11px;
}

/* Buttons */
button.act {
  min-width: 78px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-shadow: none;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
button.act:hover { border-color: var(--brass); color: var(--brass); }
button.act:active { background: rgba(214, 173, 85, 0.15); }
button.act:disabled { opacity: 0.35; cursor: default; }
button.act:disabled:hover { border-color: rgba(255, 255, 255, 0.3); color: var(--text); }

/* Items on the player */
.label {
  margin: 20px 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.owned { border-top: 1px solid var(--line); }

.owned {
  max-height: 260px;
  overflow-y: auto;
}
.owned::-webkit-scrollbar { width: 4px; }
.owned::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); }

.item {
  display: grid;
  grid-template-columns: 72px 1fr auto auto;
  align-items: center;
  gap: 12px;
  height: 48px;
  border-bottom: 1px solid var(--line);
}
.item .thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
}
.item .thumb img { max-width: 72px; max-height: 26px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.item .thumb svg { width: 64px; height: 22px; fill: #d9d5cb; }
.item .name { font-size: 14px; font-weight: 500; }

/* Ammo amount */
input.qty {
  width: 64px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: "Consolas", "Cascadia Mono", monospace;
  font-size: 12px;
  text-align: right;
  outline: none;
}
input.qty:focus { border-color: var(--brass); }
input.qty::-webkit-inner-spin-button,
input.qty::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.nothing {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
}

.foot {
  display: flex;
  align-items: center;
  height: 50px;
}

button.link {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  text-shadow: inherit;
  cursor: pointer;
}
button.link:hover { color: var(--text); }

/* Notifications */
.toasts {
  position: fixed;
  top: 7vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.toast {
  padding: 8px 16px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.45));
  border-left: 3px solid var(--brass);
  font-size: 14px;
  animation: fade 0.15s ease-out;
}
.toast.error { border-left-color: var(--err); }

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
