:root {
  --panel-bg: rgba(17, 20, 30, 0.96);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-muted: rgba(255, 255, 255, 0.65);
  --accent: #ffb347;
}

body {
  background: radial-gradient(circle at 20% -10%, rgba(247, 160, 15, 0.18), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(110, 110, 255, 0.15), transparent 55%),
    #04050b;
  color: #f8fbff;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 160px 160px;
  pointer-events: none;
}

.content {
  flex: 1;
  padding: 2.5rem clamp(1.5rem, 5vw, 3.25rem) 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
}

.inventory-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.inventory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.inventory-header h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.1rem;
  margin: 0;
  text-transform: uppercase;
}

/* VIP Equip Best Button */
.equip-best-btn {
  background: linear-gradient(135deg, rgba(247, 160, 15, 0.2), rgba(247, 160, 15, 0.1));
  border: 1px solid rgba(247, 160, 15, 0.5);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.equip-best-btn:hover {
  background: linear-gradient(135deg, rgba(247, 160, 15, 0.35), rgba(247, 160, 15, 0.2));
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(247, 160, 15, 0.3);
  transform: translateY(-1px);
}

.equip-best-btn:active {
  transform: translateY(0);
}

.equip-best-btn.locked {
  background: linear-gradient(135deg, rgba(100, 100, 100, 0.2), rgba(80, 80, 80, 0.1));
  border-color: rgba(150, 150, 150, 0.4);
  color: rgba(150, 150, 150, 0.7);
  cursor: not-allowed;
}

.equip-best-btn.locked:hover {
  transform: none;
  box-shadow: none;
  background: linear-gradient(135deg, rgba(100, 100, 100, 0.25), rgba(80, 80, 80, 0.15));
}

.equip-best-btn .lock-icon {
  margin-right: 0.25rem;
  font-size: 0.7rem;
}

.inventory-shell > .panel {
  width: 100%;
}

.panel {
  border-radius: 28px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  padding: clamp(1.2rem, 3vw, 1.65rem);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-header h2 {
  margin: 0;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-size: 1.05rem;
}

.panel-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.loadout-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.loadout-top {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}

.loadout-side {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.loadout-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(6, 1fr);
}

.loadout-figure {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.1), rgba(8, 10, 18, 0.92));
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  width: 200px;
  min-width: 200px;
  padding: 1rem;
}

.character-coming-soon {
  width: 140px;
  height: 180px;
  background: #000;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.character-coming-soon span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.loadout-figure > img:not(.companion-photo) {
  width: 140px;
  filter: drop-shadow(0 12px 30px rgba(255, 179, 71, 0.35));
}

.companion-frame {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  width: 70px;
  height: 70px;
  margin: 0;
  border: none;
  background: transparent;
  padding: 0;
  border-radius: 14px;
  cursor: pointer;
  outline: none;
  font: inherit;
  transition: transform 0.2s ease;
}

.companion-frame:focus-visible {
  outline: 2px solid rgba(247, 160, 15, 0.8);
  outline-offset: 3px;
}

.companion-frame:active {
  transform: translateY(2px);
}

.companion-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 35px rgba(0, 0, 0, 0.55));
  position: relative;
  z-index: 1;
}

.companion-overlay {
  position: absolute;
  inset: -8px;
  border-radius: 22px;
  background: rgba(4, 6, 12, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 45px rgba(0, 0, 0, 0.45);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 2;
}

.companion-frame:hover .companion-overlay,
.companion-frame:focus-within .companion-overlay {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.companion-badge {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}

.companion-overlay h4 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.companion-rank {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.companion-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 0.35rem;
}

.companion-stat {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.4rem 0.35rem;
  text-align: center;
}

.companion-stat span {
  display: block;
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.15rem;
}

.companion-stat strong {
  display: block;
  font-size: 0.95rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.companion-frame {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  width: 70px;
  height: 70px;
  margin: 0;
  border: none;
  background: transparent;
  padding: 0;
  border-radius: 14px;
  cursor: pointer;
  outline: none;
  font: inherit;
  transition: transform 0.2s ease;
}

.companion-frame:focus-visible {
  outline: 2px solid rgba(247, 160, 15, 0.8);
  outline-offset: 3px;
}

.companion-frame:active {
  transform: translateY(2px);
}

.companion-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 35px rgba(0, 0, 0, 0.55));
  position: relative;
  z-index: 1;
}

.companion-overlay {
  position: absolute;
  inset: -8px;
  border-radius: 22px;
  background: rgba(4, 6, 12, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 45px rgba(0, 0, 0, 0.45);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 2;
}

.companion-frame:hover .companion-overlay,
.companion-frame:focus-within .companion-overlay {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.companion-badge {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}

.companion-overlay h4 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.companion-rank {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.companion-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 0.35rem;
}

.companion-stat {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.4rem 0.35rem;
  text-align: center;
}

.companion-stat span {
  display: block;
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.15rem;
}

.companion-stat strong {
  display: block;
  font-size: 0.95rem;
}

.companion-tip {
  margin: 0;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.4;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.slot-card {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 11, 18, 0.9);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  text-align: center;
  justify-content: space-between;
  min-height: 180px;
  transition: border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}

.loadout-panel .slot-card {
  min-height: 160px;
}

.slot-card[data-equipped="true"] {
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(9, 11, 18, 0.95));
  color: #fff;
}

.slot-card[data-equipped="false"] {
  border-style: dashed;
  color: var(--text-muted);
  opacity: 0.5;
  filter: grayscale(1);
}

.slot-image {
  width: 100%;
  max-width: 110px;
  aspect-ratio: 1/1;
  margin: 0 auto 0.15rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
}

.slot-image img {
  width: 80%;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
  opacity: 0.95;
}

.slot-card[data-equipped="false"] .slot-image {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.02);
}

.slot-card[data-equipped="false"] .slot-image img {
  filter: grayscale(1);
  opacity: 0.45;
}

.slot-card[data-equipped="true"] .slot-image {
  border-color: rgba(255, 255, 255, 0.3);
  background: radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.18), rgba(9, 11, 18, 0.95));
}

.slot-card[data-equipped="true"] .slot-image img {
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.55));
  opacity: 1;
}

.slot-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.slot-card h3 {
  margin: 0;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.slot-card p {
  margin: 0;
}

.slot-card[data-equipped="true"] {
  border-color: rgba(255, 179, 71, 0.4);
  box-shadow: 0 0 25px rgba(255, 179, 71, 0.2);
}

.slot-power {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-attributes {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(14, 16, 25, 0.92);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.hero-attributes {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(14, 16, 25, 0.92);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.attribute-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

.element-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.element-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.attribute-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.015);
}

.attr-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.attr-label {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.attribute-card strong {
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.inventory-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.inventory-toolbar .panel-subtitle {
  max-width: 360px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.filter-row.secondary {
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.5);
}

.slot-filters,
.element-filters,
.level-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.slot-filters button,
.element-filters button,
.level-filters button {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #fff;
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.slot-filters button[data-active="true"],
.element-filters button[data-active="true"],
.level-filters button[data-active="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 179, 71, 0.12);
}

.element-filters button {
  min-width: 36px;
  text-align: center;
}

.level-filters button {
  font-family: 'Orbitron', sans-serif;
}

.inventory-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.inventory-scroll {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.inventory-scroll::-webkit-scrollbar {
  width: 6px;
}

.inventory-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.gear-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 9, 16, 0.92);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 140px;
  transition: transform 0.2s cubic-bezier(.2,.8,.2,1),
              border-color 0.2s ease,
              box-shadow 0.2s cubic-bezier(.2,.8,.2,1);
  font-size: 0.85rem;
  cursor: pointer;
}

.gear-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: hsla(38, 90%, 65%, 0.5);
  box-shadow: 
    0 14px 32px rgba(0, 0, 0, 0.4),
    0 0 16px hsla(38, 90%, 65%, 0.2);
}

.gear-card:active {
  transform: translateY(-2px) scale(0.99);
}

.gear-card[data-equipped="true"] {
  border-color: rgba(255, 179, 71, 0.8);
  box-shadow: 0 0 18px rgba(255, 179, 71, 0.15);
}

.gear-image {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.35rem;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.gear-image img {
  width: 60%;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.55));
}

/* Stack count badge */
.gear-stack-count {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: linear-gradient(135deg, rgba(247, 160, 15, 0.95), rgba(255, 180, 50, 0.9));
  color: #000;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  min-width: 24px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.gear-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.gear-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.gear-title {
  font-family: 'Orbitron', 'Inter', sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.gear-tier-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.1rem;
}

.gear-level {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(247, 160, 15, 0.15);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  letter-spacing: 0.05rem;
}

.gear-stars {
  font-size: 0.75rem;
  color: #ffd700;
  letter-spacing: -0.05rem;
  text-shadow: 0 0 4px rgba(255, 215, 0, 0.5);
}

.gear-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.gear-tags {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.gear-tag {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.1rem 0.5rem;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gear-tag[data-variant="status"] {
  border-color: rgba(255, 179, 71, 0.6);
  color: var(--accent);
}

.rare-panel h2 {
  margin-bottom: 0.3rem;
}

.rare-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.rare-total {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.resource-tabs {
  display: flex;
  gap: 0.35rem;
}

.resource-tab {
  padding: 0.4rem 0.8rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.resource-tab:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.resource-tab[data-active="true"] {
  border-color: var(--accent);
  background: rgba(255, 179, 71, 0.12);
  color: var(--accent);
}

.resource-content {
  margin-top: 0.75rem;
}

/* Resource Box Grid - Item-like display for resources */
.resource-box-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}

.resource-box {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 9, 16, 0.92);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: transform 0.2s cubic-bezier(.2,.8,.2,1),
              border-color 0.2s ease,
              box-shadow 0.2s cubic-bezier(.2,.8,.2,1);
  cursor: default;
}

.resource-box:hover {
  transform: translateY(-3px);
  border-color: hsla(38, 90%, 65%, 0.4);
  box-shadow: 
    0 10px 24px rgba(0, 0, 0, 0.35),
    0 0 12px hsla(38, 90%, 65%, 0.15);
}

.resource-box-image {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(0, 0, 0, 0.15) 100%);
  padding: 0.5rem;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.resource-box-image img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.resource-box-image .resource-emoji {
  font-size: 2rem;
}

/* Amount badge in corner */
.resource-box-amount {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: linear-gradient(135deg, rgba(247, 160, 15, 0.95), rgba(255, 180, 50, 0.9));
  color: #000;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.resource-box-label {
  font-family: 'Orbitron', 'Inter', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.2rem;
}

/* Legacy rare-grid styles (can be removed later) */
.rare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
}

.rare-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem 0.7rem;
}

.rare-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.25));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.rare-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rare-icon span {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.rare-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.rare-body .stat-meta {
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rare-body strong {
  font-size: 0.95rem;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 0.9rem 1.2rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  transform: translateY(8px);
  z-index: 10;
}

.toast[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
}

.toast[data-variant="error"] {
  border-color: rgba(255, 75, 75, 0.6);
}

.toast[data-variant="success"] {
  border-color: rgba(64, 255, 156, 0.6);
}

/* =====================================================
   GEAR CARD - Tier-based color system
   ===================================================== */

.gc {
  --tier-primary: #6b7280;
  --tier-secondary: #4b5563;
  --tier-glow: rgba(107, 114, 128, 0.4);
  --tier-text: #9ca3af;
  
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0;
  
  width: 100%;
  aspect-ratio: 0.88;
  padding: 0;
  overflow: visible; /* Allow tier badge to overflow */
  margin-top: 12px; /* Space for tier badge */
  
  background: linear-gradient(
    180deg, 
    color-mix(in srgb, var(--tier-secondary) 15%, rgba(20, 22, 30, 0.98)) 0%, 
    rgba(12, 14, 20, 0.99) 100%
  );
  border: 2px solid var(--tier-primary);
  border-radius: 10px;
  
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gc:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.5),
    0 0 24px var(--tier-glow),
    0 0 40px color-mix(in srgb, var(--tier-glow) 50%, transparent);
}

.gc[data-equipped="true"] {
  border-color: var(--accent);
  box-shadow: 
    0 0 0 2px rgba(247, 160, 15, 0.2),
    0 4px 20px rgba(247, 160, 15, 0.2);
}

/* ─────────────────────────────────────────────────────
   TIER BADGE - Floats above card (Roman numeral)
   ───────────────────────────────────────────────────── */
.gc-tier {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 20px;
  padding: 0 8px;
  
  background: linear-gradient(135deg, var(--tier-primary) 0%, var(--tier-secondary) 100%);
  border: 1px solid color-mix(in srgb, var(--tier-primary) 80%, white 20%);
  border-radius: 4px;
  
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.4),
    0 0 12px var(--tier-glow);
}

.gc-tier-num {
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: #000;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
  letter-spacing: 0.05em;
}

/* ─────────────────────────────────────────────────────
   ELEMENT ICON - Only visible on hover
   ───────────────────────────────────────────────────── */
.gc-element {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  
  font-size: 2rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.gc:hover .gc-element {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

/* ─────────────────────────────────────────────────────
   ZONE 1: Header - Stars centered
   ───────────────────────────────────────────────────── */
.gc-header {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 14px 8px 6px;
  
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Stars - tier colored (shows subtier 1-5) */
.gc-stars {
  display: flex;
  gap: 2px;
}

.gc-stars .star {
  font-size: 0.95rem;
  line-height: 1;
  transition: all 0.15s ease;
}

.gc-stars .star.lit {
  color: var(--tier-text);
  text-shadow: 
    0 0 6px var(--tier-glow),
    0 0 12px var(--tier-glow),
    0 1px 3px rgba(0, 0, 0, 0.5);
  filter: drop-shadow(0 0 3px var(--tier-primary));
}

.gc-stars .star.dim {
  color: rgba(255, 255, 255, 0.1);
}

/* ─────────────────────────────────────────────────────
   ZONE 2: Visual - Item with element color overlay
   ───────────────────────────────────────────────────── */
.gc-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  
  background: radial-gradient(
    ellipse 80% 70% at center 50%,
    var(--tier-glow) 0%,
    transparent 65%
  );
}

.gc-img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.gc-img {
  max-width: 90%;
  max-height: 68px;
  object-fit: contain;
  opacity: 0.75;
  
  filter: 
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6))
    drop-shadow(0 6px 16px var(--tier-glow));
  
  transition: transform 0.25s ease, filter 0.25s ease, opacity 0.25s ease;
}

.gc:hover .gc-img {
  opacity: 1;
}

/* Element-based color effects on image */
/* Fire - Red tint, no glow */
.gc[data-element="fire"] .gc-img {
  filter: 
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6))
    sepia(0.5) saturate(2) hue-rotate(-20deg) brightness(1.05);
}

/* Water - Blue tint */
.gc[data-element="water"] .gc-img {
  filter: 
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6))
    drop-shadow(0 6px 16px rgba(66, 165, 245, 0.4))
    sepia(0.2) saturate(1.3) hue-rotate(180deg);
}

/* Earth - White/bright (like old air) */
.gc[data-element="earth"] .gc-img {
  filter: 
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6))
    drop-shadow(0 6px 16px rgba(200, 200, 220, 0.4))
    brightness(1.15) contrast(0.95) saturate(0.7);
}

/* Air - Greyscale/silver tint */
.gc[data-element="air"] .gc-img {
  filter: 
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6))
    grayscale(0.8) brightness(1.15) contrast(1.05);
}

.gc:hover .gc-img {
  transform: scale(1.08) translateY(-2px);
}

/* Fire hover - stronger red, no glow */
.gc[data-element="fire"]:hover .gc-img {
  filter: 
    drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7))
    sepia(0.5) saturate(2.2) hue-rotate(-20deg) brightness(1.15);
}

/* Water hover */
.gc[data-element="water"]:hover .gc-img {
  filter: 
    drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7))
    drop-shadow(0 10px 24px rgba(66, 165, 245, 0.5))
    sepia(0.2) saturate(1.4) hue-rotate(180deg) brightness(1.1);
}

/* Earth hover - brighter white */
.gc[data-element="earth"]:hover .gc-img {
  filter: 
    drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7))
    drop-shadow(0 10px 24px rgba(200, 200, 220, 0.5))
    brightness(1.25) contrast(0.95) saturate(0.7);
}

/* Air hover - greyscale silver */
.gc[data-element="air"]:hover .gc-img {
  filter: 
    drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7))
    grayscale(0.7) brightness(1.25) contrast(1.1);
}

/* Default (no element) hover */
.gc[data-element="none"]:hover .gc-img {
  filter: 
    drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7))
    drop-shadow(0 10px 24px var(--tier-glow))
    brightness(1.08);
}

.gc-placeholder {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

/* Stack badge - Orange for visibility */
.gc-stack {
  position: absolute;
  bottom: 4px;
  right: 4px;
  
  padding: 3px 8px;
  background: linear-gradient(135deg, #ff8c00 0%, #ff5500 100%);
  border-radius: 6px;
  border: 2px solid #fff;
  
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  
  box-shadow: 0 2px 8px rgba(255,85,0,0.6), 0 0 12px rgba(255,140,0,0.4);
}

/* Equipped badge */
.gc-equipped-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  
  background: var(--accent);
  border-radius: 3px;
  
  font-family: 'Orbitron', sans-serif;
  font-size: 0.5rem;
  font-weight: 800;
  color: #000;
  
  box-shadow: 0 0 8px rgba(247, 160, 15, 0.6);
}

/* ─────────────────────────────────────────────────────
   ZONE 3: Stats
   ───────────────────────────────────────────────────── */
.gc-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  
  padding: 6px 6px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.gc-stats[data-count="1"] { justify-content: center; }
.gc-stats[data-count="2"] .gc-stat { flex: 1; justify-content: center; }
.gc-stats[data-count="3"] .gc-stat { flex: 1; justify-content: center; }

.gc-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.gc-stat-icon {
  font-size: 0.75rem;
  line-height: 1;
  opacity: 0.9;
}

.gc-stat-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

/* ─────────────────────────────────────────────────────
   Tier Theme Specifics
   ───────────────────────────────────────────────────── */

/* Grey (Tier 1-5) */
.gc[data-tier-theme="grey"] {
  background: linear-gradient(180deg, rgba(45, 50, 60, 0.95) 0%, rgba(20, 22, 28, 0.99) 100%);
}

/* Bronze (Tier 6-10) */
.gc[data-tier-theme="bronze"] {
  background: linear-gradient(180deg, rgba(50, 38, 28, 0.95) 0%, rgba(25, 18, 12, 0.99) 100%);
}
.gc[data-tier-theme="bronze"] .gc-subtier-num { color: #1a1a1a; }

/* Silver (Tier 11-15) */
.gc[data-tier-theme="silver"] {
  background: linear-gradient(180deg, rgba(55, 55, 65, 0.95) 0%, rgba(28, 28, 35, 0.99) 100%);
}
.gc[data-tier-theme="silver"] .gc-subtier-num { color: #1a1a1a; }

/* Gold (Tier 16-20) */
.gc[data-tier-theme="gold"] {
  background: linear-gradient(180deg, rgba(55, 48, 25, 0.95) 0%, rgba(30, 25, 12, 0.99) 100%);
}
.gc[data-tier-theme="gold"] .gc-subtier-num { color: #1a1a1a; }

/* Diamond (Tier 21-25) */
.gc[data-tier-theme="diamond"] {
  background: linear-gradient(180deg, rgba(35, 55, 65, 0.95) 0%, rgba(18, 28, 35, 0.99) 100%);
}
.gc[data-tier-theme="diamond"] .gc-subtier-num { color: #0a2a3a; }

/* Ruby (Tier 26-30) */
.gc[data-tier-theme="ruby"] {
  background: linear-gradient(180deg, rgba(55, 25, 35, 0.95) 0%, rgba(30, 12, 18, 0.99) 100%);
}
.gc[data-tier-theme="ruby"] .gc-subtier-num { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }

/* Emerald (Tier 31+) */
.gc[data-tier-theme="emerald"] {
  background: linear-gradient(180deg, rgba(25, 50, 38, 0.95) 0%, rgba(12, 28, 20, 0.99) 100%);
}
.gc[data-tier-theme="emerald"] .gc-subtier-num { color: #0a2a1a; }

/* ─────────────────────────────────────────────────────
   Empty Slot Card
   ───────────────────────────────────────────────────── */
.gc.gc-empty {
  opacity: 0.6;
  border-style: dashed;
}

.gc.gc-empty:hover {
  opacity: 0.85;
}

.gc-slot-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
}

.gc-img-empty {
  opacity: 0.4 !important;
  filter: 
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3))
    grayscale(0.5) !important;
}

.gc-stat-empty .gc-stat-val {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.6rem;
}

/* ─────────────────────────────────────────────────────
   Unequip Card
   ───────────────────────────────────────────────────── */
.gc.gc-unequip {
  background: linear-gradient(180deg, rgba(60, 30, 30, 0.95) 0%, rgba(30, 15, 15, 0.99) 100%);
  border-color: #ef4444;
}

.gc.gc-unequip:hover {
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(239, 68, 68, 0.4),
    0 0 40px rgba(239, 68, 68, 0.2);
}

.gc.gc-unequip .gc-slot-label {
  color: #fca5a5;
  font-weight: 700;
}

/* ─────────────────────────────────────────────────────
   Select Gear Panel
   ───────────────────────────────────────────────────── */
.select-gear-panel .close-btn {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.select-gear-panel .close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ─────────────────────────────────────────────────────
   Inventory Grid
   ───────────────────────────────────────────────────── */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  padding-top: 4px; /* Extra space for subtier badges */
}

/* ─────────────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .gc {
    aspect-ratio: 0.9;
    margin-top: 10px;
  }
  
  .gc-subtier {
    min-width: 24px;
    height: 18px;
    top: -8px;
  }
  
  .gc-subtier-num {
    font-size: 0.6rem;
  }
  
  .gc-header {
    padding: 8px 6px 5px;
  }
  
  .gc-element {
    font-size: 0.75rem;
  }
  
  .gc-stars .star {
    font-size: 0.8rem;
  }
  
  .gc-img {
    max-height: 55px;
  }
  
  .gc-stats {
    padding: 5px;
  }
  
  .gc-stat-icon {
    font-size: 0.65rem;
  }
  
  .gc-stat-val {
    font-size: 0.6rem;
  }
  
  .inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 10px;
  }
}

@media (max-width: 1200px) {
  .content {
    padding: 2rem 1.5rem 3rem;
  }

  .inventory-scroll {
    max-height: none;
  }
}

@media (max-width: 1024px) {
  .loadout-top {
    flex-direction: column;
  }
  .loadout-figure {
    width: 100%;
    min-width: auto;
    min-height: 180px;
  }
  .loadout-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  .loadout-figure {
    grid-column: span 1;
    min-height: 240px;
  }

  .content {
    padding: 1.75rem 1rem 2.5rem;
  }
}


