/* =========================================================================
   trunk.css  —  საბარგული (CEF.TRUNK = 24 / page-trunk)
   -------------------------------------------------------------------------
   დიზაინი ზუსტად ინვენტარის (inventory.css) ფერებში და სტილში:
   წითელი აქცენტი, ჩარჩოების გარეშე სლოტები, იგივე ტიპოგრაფია.
   ყველა სელექტორი დასკოპულია #page-trunk-ზე.
   ========================================================================= */

#page-trunk {
  --red: #ff4747;
  --red-dim: #ff474722;
  --light: #eaeaea;
  --muted: #eaeaea73;
  --black: #0a0a0a;
  --line: #eaeaea1a;
  --slot: clamp(46px, min(6.2vh, 4.1vw), 78px);
  --gap: 10px;
  --font-head: "Rajdhani", "Manrope", "Segoe UI", Arial, sans-serif;
  --font-body: "Manrope", "Segoe UI", Arial, sans-serif;

  font-family: var(--font-body);
  color: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 30% 20%, #ff474718 0%, transparent 55%),
    radial-gradient(ellipse at 80% 90%, #ff474710 0%, transparent 50%),
    rgba(8, 8, 8, 0.88);
  overflow: hidden;
}

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

/* ---------- ESC ---------- */
#page-trunk .esc-btn {
  position: fixed;
  top: 28px;
  right: 36px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-head);
}
#page-trunk .esc-key {
  background: var(--light);
  color: var(--black);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  border-radius: 6px;
}
#page-trunk .esc-label {
  color: var(--light);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
  transition: color 0.15s;
}
#page-trunk .esc-btn:hover .esc-label { color: var(--red); }
#page-trunk .esc-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; border-radius: 6px; }

/* ---------- Layout ---------- */
#page-trunk .trk-wrap {
  display: flex;
  gap: 90px;
  align-items: flex-start;
  padding: 32px;
}

#page-trunk .trk-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#page-trunk .trk-head {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
#page-trunk .trk-title {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.35em;
  display: flex;
  align-items: center;
  gap: 14px;
}
#page-trunk .trk-title::before {
  content: "";
  width: 34px;
  height: 2px;
  background: var(--red);
  border-radius: 2px;
}
#page-trunk .trk-sub {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}
#page-trunk .trk-sub b { color: var(--light); font-weight: 700; }

#page-trunk .trk-count {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
#page-trunk .trk-count b { color: var(--red); font-weight: 700; }

/* ---------- Grids / slots ---------- */
#page-trunk .trk-grid {
  display: grid;
  grid-template-columns: repeat(6, var(--slot));
  gap: var(--gap);
}
#page-trunk .trk-grid.scroll {
  max-height: calc(var(--slot) * 6 + var(--gap) * 5 + 4px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #ff474766 transparent;
}

#page-trunk .trk-slot {
  position: relative;
  width: var(--slot);
  height: var(--slot);
  background: #eaeaea0d;
  border: 1px solid transparent;
  border-radius: 8px;
  display: grid;
  place-items: center;
  transition: background 0.15s, border-color 0.15s;
}
#page-trunk .trk-slot:hover { background: #eaeaea1a; }
#page-trunk .trk-slot.filled { cursor: grab; }
#page-trunk .trk-slot.filled:active { cursor: grabbing; }
#page-trunk .trk-slot.dragging { opacity: 0.35; }
#page-trunk .trk-slot.over { border-color: var(--red); background: var(--red-dim); }
#page-trunk .trk-slot.equipped {
  border-color: var(--red);
  box-shadow: inset 0 0 14px #ff474759;
}

#page-trunk .trk-icon {
  width: 92%;
  height: 92%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.7));
}
#page-trunk .trk-icon.emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--slot) * 0.42);
}
#page-trunk .trk-badge {
  position: absolute;
  right: 6px;
  bottom: 3px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}
#page-trunk .trk-badge.dim { color: var(--muted); }
#page-trunk .trk-tag {
  position: absolute;
  right: 5px;
  top: 3px;
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
}

/* ---------- Divider between the two columns ---------- */
#page-trunk .trk-divider {
  align-self: stretch;
  width: 2px;
  margin-top: 34px;
  background: linear-gradient(to bottom, var(--red), transparent);
  border-radius: 2px;
  opacity: 0.55;
}

#page-trunk .trk-hint {
  margin-top: 18px;
  width: 100%;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}
#page-trunk .trk-hint b { color: var(--light); font-weight: 700; }

/* ---------- Tooltip / context menu / toast ---------- */
#page-trunk .trk-tip {
  position: fixed;
  display: none;
  pointer-events: none;
  z-index: 30;
  max-width: 220px;
  background: #141414;
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
}
#page-trunk .trk-tip b { display: block; font-size: 13px; margin-bottom: 2px; }
#page-trunk .trk-tip span { color: var(--muted); }

#page-trunk .trk-menu {
  position: fixed;
  display: none;
  z-index: 40;
  min-width: 190px;
  background: #141414;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
}
#page-trunk .trk-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--light);
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 5px;
  cursor: pointer;
}
#page-trunk .trk-menu button:hover { background: var(--red); color: #fff; }
#page-trunk .trk-menu button:focus-visible { outline: 2px solid var(--red); }
#page-trunk .trk-amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px 8px;
  font-size: 12px;
  color: var(--muted);
}
#page-trunk .trk-amount input {
  width: 74px;
  background: #eaeaea0d;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--light);
  font: inherit;
  padding: 4px 6px;
}
#page-trunk .trk-amount input:focus { outline: 2px solid var(--red); }

#page-trunk .trk-toast {
  position: fixed;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--red);
  color: #fff;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}
#page-trunk .trk-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Small screens ---------- */
@media (max-width: 1100px) {
  #page-trunk .trk-wrap { flex-direction: column; align-items: center; gap: 24px; overflow-y: auto; max-height: 96vh; }
  #page-trunk .trk-divider { display: none; }
  #page-trunk { --slot: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  #page-trunk * { transition: none !important; }
}
