:root {
  --bg: #000000;
  --bg-2: #1a0b1f;
  --surface: rgba(18, 18, 18, 0.9);
  --surface-strong: rgba(30, 30, 30, 0.95);
  --line: rgba(92, 2, 110, 0.34);
  --text: #ffffff;
  --muted: #b0b0b0;
  --accent: #5c026e;
  --accent-2: #b857d1;
  --danger: #ff6f7d;
  --shadow: 0 16px 48px rgba(92, 2, 110, 0.2);
  --constructor-width: 600px;
  --constructor-height: 90px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Comfortaa', 'Manrope', 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(184, 87, 209, 0.17), transparent 36%),
    radial-gradient(circle at 90% 0%, rgba(92, 2, 110, 0.2), transparent 34%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(20px);
  opacity: 0.35;
  pointer-events: none;
}

.bg-orb-1 {
  width: 320px;
  height: 320px;
  background: #5c026e;
  left: -90px;
  top: -90px;
}

.bg-orb-2 {
  width: 420px;
  height: 420px;
  background: #b857d1;
  right: -150px;
  bottom: -180px;
}

.page {
  width: min(1520px, 97vw);
  margin: 24px auto 32px;
  display: grid;
  gap: 16px;
}

.hero h1 {
  margin: 0;
  font: 700 34px/1.1 'Comfortaa', sans-serif;
}

.eyebrow {
  margin: 0 0 8px;
  font: 600 12px/1 'Comfortaa', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.subtitle {
  margin: 12px 0 0;
  max-width: 740px;
  color: var(--muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid rgba(92, 2, 110, 0.5);
  background: rgba(92, 2, 110, 0.18);
  color: var(--text);
  font: 700 13px/1 'Comfortaa', sans-serif;
  padding: 10px 14px;
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(184, 87, 209, 0.85);
}

.btn-main {
  background: linear-gradient(135deg, #5c026e 0%, #7a1b8f 100%);
  border-color: rgba(184, 87, 209, 0.7);
  color: #ffffff;
}

.status {
  color: var(--muted);
  font-size: 14px;
}

.workspace-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: 390px minmax(0, 1fr);
}

.right-column {
  display: grid;
  gap: 16px;
}

.lists-panel h2,
.preview-panel h2,
.packs-panel h2 {
  margin: 0 0 10px;
}

.packs-panel {
  width: 100%;
}

.lists-panel h2:not(:first-child) {
  margin-top: 14px;
}

.preview-panel {
  overflow-x: auto;
}

.preview-card {
  width: var(--constructor-width);
  min-width: var(--constructor-width);
  max-width: var(--constructor-width);
  height: var(--constructor-height);
  min-height: var(--constructor-height);
  max-height: var(--constructor-height);
  position: relative;
  overflow: hidden;
  border-radius: 0;
  border: 1px solid rgba(92, 2, 110, 0.46);
  background: linear-gradient(120deg, #121212, #1e1e1e);
}

.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.layer-stickers {
  position: absolute;
  inset: 0;
}

.preview-sticker {
  position: absolute;
  transform-origin: center center;
}

.player-meta {
  margin-top: 10px;
  color: var(--muted);
}

.sticker-controls {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.slot-select {
  display: flex;
  gap: 8px;
}

.slot-btn {
  border-radius: 0;
  border: 1px solid rgba(92, 2, 110, 0.55);
  background: rgba(92, 2, 110, 0.2);
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 700;
}

.slot-btn.active {
  border-color: rgba(184, 87, 209, 0.9);
  background: rgba(184, 87, 209, 0.24);
}

.range-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
}

.range-grid label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  max-height: 430px;
  overflow: auto;
}

.catalog-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: 230px;
}

.catalog-grid-compact::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.catalog-grid-compact {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.catalog-card {
  position: relative;
  border: 1px solid rgba(92, 2, 110, 0.5);
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  background: rgba(18, 18, 18, 0.86);
}

.catalog-card img {
  display: block;
  width: 100%;
  height: 74px;
  object-fit: cover;
}

.catalog-card .label {
  padding: 8px;
  font-size: 12px;
  color: #e3d3eb;
}

.catalog-card.selected {
  border-color: rgba(184, 87, 209, 0.95);
  box-shadow: 0 0 0 1px rgba(184, 87, 209, 0.45);
}

.catalog-card.locked::after {
  content: 'Недоступно';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  display: grid;
  place-items: center;
  font: 700 12px/1 'Comfortaa', sans-serif;
}

.packs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.pack-card {
  border: 1px solid rgba(132, 54, 156, 0.56);
  background:
    radial-gradient(circle at 10% -40%, rgba(184, 87, 209, 0.22), transparent 55%),
    linear-gradient(145deg, rgba(24, 19, 29, 0.96), rgba(15, 15, 15, 0.96));
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pack-card:hover {
  transform: translateY(-2px);
  border-color: rgba(196, 117, 220, 0.86);
  box-shadow: 0 10px 28px rgba(92, 2, 110, 0.25);
}

.pack-card-japan {
  background:
    radial-gradient(circle at 100% 0, rgba(255, 90, 120, 0.2), transparent 38%),
    radial-gradient(circle at 0 100%, rgba(184, 87, 209, 0.18), transparent 40%),
    linear-gradient(145deg, rgba(26, 18, 26, 0.96), rgba(15, 15, 15, 0.96));
}

.pack-card-bugaga {
  background:
    radial-gradient(circle at 90% -10%, rgba(251, 198, 20, 0.2), transparent 38%),
    linear-gradient(145deg, rgba(32, 24, 17, 0.96), rgba(15, 15, 15, 0.96));
}

.pack-card-beach {
  background:
    radial-gradient(circle at 90% -10%, rgba(80, 196, 255, 0.26), transparent 38%),
    linear-gradient(145deg, rgba(17, 24, 35, 0.96), rgba(15, 15, 15, 0.96));
}

.pack-card-fair {
  background:
    radial-gradient(circle at 90% -10%, rgba(255, 171, 87, 0.24), transparent 38%),
    linear-gradient(145deg, rgba(35, 21, 17, 0.96), rgba(15, 15, 15, 0.96));
}

.pack-card-court {
  background:
    radial-gradient(circle at 90% -10%, rgba(255, 102, 122, 0.24), transparent 38%),
    linear-gradient(145deg, rgba(31, 17, 19, 0.96), rgba(15, 15, 15, 0.96));
}

.pack-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pack-title {
  font-size: 14px;
  line-height: 1.25;
  color: #f8ecff;
}

.pack-count {
  color: #d8bbdf;
  font-size: 12px;
}

.pack-price {
  color: #2d0a35;
  background: linear-gradient(135deg, #e6a3f7, #cb7de2);
  border: 1px solid rgba(245, 205, 255, 0.4);
  padding: 5px 8px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
}

.pack-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.pack-items img {
  width: 100%;
  height: 48px;
  max-width: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(92, 2, 110, 0.5);
}

.pack-more {
  min-height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font: 700 12px/1 'Comfortaa', sans-serif;
  color: #ead5f1;
  border: 1px dashed rgba(172, 110, 192, 0.8);
  background: rgba(92, 2, 110, 0.2);
}

.pack-empty {
  border: 1px dashed rgba(140, 96, 156, 0.8);
  border-radius: 12px;
  padding: 12px;
  color: #c5a8cf;
  font-size: 13px;
  text-align: center;
  background: rgba(92, 2, 110, 0.12);
}

#stickersGrid .catalog-card img {
  height: 56px;
  object-fit: contain;
  padding: 6px;
  background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 1280px) {
  .packs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .packs-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .packs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .packs-grid {
    grid-template-columns: 1fr;
  }
}
