:root {
  --bg: #0b1020;
  --panel: #121a2b;
  --panel-2: #172238;
  --panel-3: #0f1729;
  --line: #263654;
  --text: #eef4ff;
  --muted: #8ea1bf;
  --accent: #5865f2;
  --accent-2: #2f81f7;
  --warn: #9db8ff;
  --danger: #ff607d;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 8%, rgba(88, 101, 242, 0.16), transparent 24rem),
    radial-gradient(circle at 86% 18%, rgba(47, 129, 247, 0.12), transparent 22rem),
    linear-gradient(135deg, #080d19 0%, #0d1425 48%, #0a0f1d 100%);
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid rgba(38, 54, 84, 0.8);
  background: rgba(10, 15, 29, 0.94);
  padding: 22px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(88, 101, 242, 0.7);
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.36), rgba(47, 129, 247, 0.26));
  border-radius: 8px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
}

h2 {
  margin-top: 4px;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.05;
}

h3 {
  font-size: 15px;
}

.brand p,
.eyebrow,
label,
.status,
.output-head span {
  color: var(--muted);
}

.tabs {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
}

.tab,
button,
select,
input,
textarea {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel);
  border-radius: 6px;
}

.tab,
button {
  min-height: 40px;
  cursor: pointer;
}

.tab {
  text-align: left;
  padding: 0 12px;
}

.tab.active,
.primary {
  border-color: rgba(88, 101, 242, 0.82);
  background: linear-gradient(135deg, #5865f2, #2f81f7);
  color: white;
  font-weight: 700;
}

.panel {
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid rgba(38, 54, 84, 0.84);
  background: rgba(18, 26, 43, 0.9);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.panel + .panel {
  margin-top: 12px;
}

.compact,
.controls-card {
  box-shadow: none;
}

label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

select,
input,
textarea {
  width: 100%;
  padding: 11px 12px;
  outline: none;
}

input[type="file"] {
  color: var(--muted);
}

textarea {
  min-height: 260px;
  resize: vertical;
  line-height: 1.5;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  text-transform: none;
  font-weight: 600;
}

.check input {
  width: 16px;
}

.workspace {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status span {
  border: 1px solid var(--line);
  background: rgba(18, 26, 43, 0.82);
  border-radius: 999px;
  padding: 7px 10px;
}

.mode {
  display: none;
}

.mode.active {
  display: block;
}

.toolbar {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.preset {
  min-height: 142px;
  padding: 15px;
  text-align: left;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(23, 34, 56, 0.98), rgba(13, 20, 37, 0.98));
}

.preset:hover,
.item-card:hover,
.slot:hover {
  border-color: rgba(88, 101, 242, 0.86);
}

.preset strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.preset span {
  display: inline-block;
  margin-bottom: 11px;
  color: var(--warn);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.preset p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
}

.catalog-toolbar {
  grid-template-columns: 1fr;
}

.catalog-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  max-height: 56vh;
  overflow: auto;
  padding-right: 4px;
}

.item-card {
  display: grid;
  grid-template-rows: 66px auto auto;
  gap: 7px;
  min-height: 138px;
  padding: 10px;
  text-align: left;
  background: rgba(18, 26, 43, 0.94);
}

.icon-frame,
.slot-icon,
.container-icon {
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(142, 161, 191, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent),
    var(--panel-3);
  border-radius: 6px;
}

.icon-frame {
  width: 100%;
  height: 66px;
}

.icon-frame img,
.slot-icon img,
.container-icon img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  padding: 7px;
  object-fit: contain;
  object-position: center;
}

.fallback-icon {
  color: #9db8ff;
  font-size: 15px;
  font-weight: 800;
}

.item-name {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.item-cat {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.loadout {
  align-self: start;
  position: sticky;
  top: 18px;
}

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

.loadout-head button {
  min-height: 34px;
  padding: 0 10px;
}

.loadout-box {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  min-height: 220px;
}

.container-icon {
  width: 76px;
  height: 76px;
  border-color: rgba(88, 101, 242, 0.56);
}

.selected-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  align-content: start;
  gap: 8px;
}

.slot {
  position: relative;
  min-height: 72px;
  padding: 0;
  background: transparent;
  border-color: transparent;
}

.slot-icon {
  width: 54px;
  height: 54px;
}

.slot small {
  display: block;
  width: 54px;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.split,
.event-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 16px;
}

.quick div {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.ghost {
  background: var(--panel-2);
}

.output {
  overflow: hidden;
  border: 1px solid rgba(88, 101, 242, 0.3);
  background: #080d19;
  border-radius: 7px;
  box-shadow: var(--shadow);
}

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

.output-head div {
  display: grid;
  gap: 4px;
}

.copy-output {
  min-width: 132px;
  min-height: 44px;
  padding: 0 18px;
  box-shadow: 0 12px 28px rgba(47, 129, 247, 0.24);
}

pre {
  min-height: 120px;
  max-height: 300px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #c7d6ff;
}

@media (max-width: 900px) {
  .shell,
  .split,
  .event-grid,
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
