﻿:root {
  --bg: #080a0f;
  --bg-2: #0d1119;
  --panel: rgba(18, 22, 32, .88);
  --panel-2: rgba(25, 30, 43, .94);
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 54, 54, .42);
  --text: #f7f7f4;
  --muted: #a4a8b5;
  --red: #ff3131;
  --red-2: #b60f16;
  --violet: #8b3dff;
  --gold: #f0c56b;
  --green: #44d88a;
  --danger: #ff6b7a;
  --shadow: 0 24px 80px rgba(0, 0, 0, .42);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 5%, rgba(255, 49, 49, .22), transparent 30rem),
    radial-gradient(circle at 92% 12%, rgba(139, 61, 255, .18), transparent 34rem),
    linear-gradient(135deg, #050609 0%, #0b0d12 52%, #111018 100%);
  font-family: "Segoe UI", "Inter", "Trebuchet MS", sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .2;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}
button, input, select { font: inherit; }
button, input, select {
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(7, 9, 14, .78);
}
button { min-height: 42px; padding: 0 15px; cursor: pointer; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
button:hover, .preset:hover, .item-card:hover { transform: translateY(-1px); border-color: var(--line-strong); }
input, select { width: 100%; padding: 12px 13px; outline: none; }
input:focus, select:focus { border-color: rgba(255, 49, 49, .75); box-shadow: 0 0 0 4px rgba(255, 49, 49, .12); }
label { color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(21px, 2.4vw, 32px); letter-spacing: -.04em; }
h2 { font-size: clamp(18px, 2vw, 25px); letter-spacing: -.03em; }
.eyebrow { color: var(--gold); font-size: 11px; font-weight: 950; letter-spacing: .15em; text-transform: uppercase; }
.muted, .description, .top-actions, .container-row span { color: var(--muted); }
.primary {
  border-color: rgba(255, 49, 49, .75);
  background: linear-gradient(135deg, var(--red), var(--red-2));
  color: white;
  font-weight: 950;
  box-shadow: 0 14px 34px rgba(255, 49, 49, .22);
}
.primary.full { width: 100%; }
.ghost { background: rgba(255,255,255,.04); color: var(--muted); font-weight: 850; }

.login-screen { position: relative; display: grid; min-height: 100vh; place-items: center; padding: 24px; overflow: hidden; }
.login-screen.hidden { display: none; }
.login-orb { position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(255,49,49,.28), transparent 66%); filter: blur(20px); animation: pulse 4s ease-in-out infinite; }
.login-card {
  position: relative;
  display: grid;
  gap: 13px;
  width: min(430px, 100%);
  padding: 34px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(20,24,34,.94), rgba(8,10,15,.92));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.login-card h1 { font-size: clamp(42px, 8vw, 68px); line-height: .88; }
.login-copy, .login-note { color: var(--muted); font-size: 14px; line-height: 1.45; }
.login-error { min-height: 19px; color: var(--danger); font-size: 13px; font-weight: 800; }

.shell { display: grid; gap: 18px; min-height: 100vh; padding: 20px; }
.shell.locked { display: none; }
.topbar, .command-bar, .output-head, .section-head, .container-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.topbar { position: sticky; top: 0; z-index: 10; padding: 14px 16px; border: 1px solid var(--line); border-radius: 24px; background: rgba(8,10,15,.78); backdrop-filter: blur(18px); box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(255, 49, 49, .65);
  border-radius: 17px;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.18), transparent 36%), linear-gradient(135deg, rgba(255, 49, 49, .48), rgba(139, 61, 255, .22));
  color: white;
  font-weight: 1000;
  letter-spacing: -.08em;
  box-shadow: 0 0 32px rgba(255,49,49,.2);
}
.top-actions { display: flex; align-items: center; gap: 10px; }
.status-dot { display: inline-flex; align-items: center; gap: 9px; font-weight: 750; }
.status-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 18px var(--green); }

.hero-panel, .command-bar, .panel, .output {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hero-panel { display: grid; grid-template-columns: minmax(0, 1fr) 1.15fr; gap: 22px; align-items: center; padding: 20px; }
.hero-panel p:not(.eyebrow) { margin-top: 8px; color: var(--muted); line-height: 1.55; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.steps article { display: grid; gap: 8px; min-height: 82px; padding: 13px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: rgba(255,255,255,.04); }
.steps strong { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 11px; background: linear-gradient(135deg, var(--red), var(--violet)); }
.steps span { color: var(--text); font-size: 13px; font-weight: 850; }
.command-bar { display: grid; grid-template-columns: 260px minmax(320px, 1fr) 178px; padding: 15px; }
.check { display: flex; align-items: center; justify-content: center; gap: 8px; text-transform: none; }
.check input { width: 18px; accent-color: var(--red); }
.layout { display: grid; grid-template-columns: 320px minmax(0, 1fr) 330px; gap: 18px; }
.panel { min-height: 0; padding: 16px; }
.packs-panel, .catalog-panel, .preview-panel { display: grid; align-content: start; gap: 14px; }
.search { background: rgba(7, 9, 14, .64); }
.preset-list, .item-grid, .selected-grid { display: grid; gap: 10px; }
.preset-list, .item-grid { max-height: 60vh; overflow: auto; padding-right: 5px; }
.preset {
  display: grid;
  gap: 9px;
  min-height: 112px;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
}
.preset.active { border-color: rgba(255,49,49,.72); background: linear-gradient(135deg, rgba(255,49,49,.18), rgba(139,61,255,.11)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
.preset strong, .item-name { overflow: hidden; text-overflow: ellipsis; }
.preset span, .pill {
  width: fit-content;
  border: 1px solid rgba(240, 197, 107, .34);
  border-radius: 999px;
  padding: 6px 9px;
  color: #f6d893;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.preset p, .description { color: var(--muted); font-size: 13px; line-height: 1.45; }
.container-row { justify-content: flex-start; padding: 13px; border: 1px solid var(--line); border-radius: 18px; background: rgba(0,0,0,.2); }
.container-row div:last-child { display: grid; gap: 4px; }
.selected-grid { grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); }
.item-grid { grid-template-columns: 1fr; }
.item-card, .slot {
  display: grid;
  gap: 9px;
  min-height: 126px;
  padding: 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7, 9, 14, .72);
}
.slot { cursor: default; }
.icon-frame, .slot-icon, .container-icon {
  display: grid;
  position: relative;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.12), transparent 48%), #07090e;
}
.icon-frame { height: 68px; }
.slot-icon { height: 72px; }
.container-icon { width: 82px; height: 82px; }
.icon-frame img, .slot-icon img, .container-icon img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; padding: 9px; object-fit: contain; object-position: center; }
.fallback-icon { display: grid; place-items: center; width: 100%; height: 100%; color: #f1c76a; font-weight: 1000; letter-spacing: -.04em; background: linear-gradient(135deg, rgba(255,49,49,.18), rgba(139,61,255,.14)); }
.item-name, .slot small { color: var(--text); font-size: 12px; line-height: 1.25; word-break: break-word; }
.item-card .item-name { min-height: 31px; }
.slot small { color: var(--muted); }
.output { overflow: hidden; }
.output-head { padding: 15px 16px; border-bottom: 1px solid var(--line); }
pre { min-height: 116px; max-height: 290px; overflow: auto; margin: 0; padding: 17px; color: #ffe7a6; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.5; background: rgba(0,0,0,.28); }

@keyframes pulse { 0%, 100% { transform: scale(.94); opacity: .7; } 50% { transform: scale(1.06); opacity: 1; } }
@media (max-width: 1200px) { .layout { grid-template-columns: 300px minmax(0, 1fr); } .catalog-panel { grid-column: 1 / -1; } .item-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
@media (max-width: 900px) { .hero-panel, .command-bar, .layout { grid-template-columns: 1fr; } .steps { grid-template-columns: repeat(2, 1fr); } .preset-list, .item-grid { max-height: none; } }
@media (max-width: 620px) { .shell { padding: 12px; } .topbar, .section-head, .output-head { align-items: stretch; flex-direction: column; } .top-actions { justify-content: space-between; } .steps { grid-template-columns: 1fr; } .selected-grid, .item-grid { grid-template-columns: 1fr; } }
