* {
  box-sizing: border-box;
}

:root {
  --bg: #090d16;
  --panel: #121a28;
  --text: #edf2ff;
  --muted: #a9b4cc;
  --accent: #6ea8ff;
  --accent-2: #8cf0c4;
  --accent-3: #ffd580;
  --border: rgba(170, 195, 255, 0.18);
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 5%, rgba(110, 168, 255, 0.14), transparent 34%),
    radial-gradient(circle at 85% 15%, rgba(140, 240, 196, 0.1), transparent 30%),
    linear-gradient(180deg, #090d16, #05070d);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 14px 18px 24px;
}

.final-topbar {
  margin-bottom: 12px;
  text-align: center;
}

.final-topbar h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
}

.element-selection-shell {
  display: grid;
  place-items: center;
}

.element-selector-card,
.viewer-card {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(24, 35, 55, 0.9), rgba(8, 13, 24, 0.98));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

.element-selector-card {
  max-width: 940px;
  padding: 18px 22px 16px;
}

.element-selector-card h2 {
  margin: 0 0 14px;
  text-align: center;
  font-size: 1.15rem;
  color: var(--accent-2);
}

.dual-wheel-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.element-wheel-block h3 {
  margin: 0 0 8px;
  text-align: center;
  color: var(--text);
  font-size: 1rem;
}

.element-wheel {
  position: relative;
  height: 132px;
  overflow: hidden;
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 22px;
  border: 1px solid rgba(180, 210, 255, 0.16);
  background: rgba(5, 10, 22, 0.72);
  scrollbar-width: none;
}

.element-wheel::-webkit-scrollbar {
  display: none;
}

.element-wheel::before,
.element-wheel::after {
  content: "";
  position: sticky;
  z-index: 2;
  left: 0;
  right: 0;
  height: 22px;
  pointer-events: none;
}

.element-wheel::before {
  top: 0;
  margin-bottom: -22px;
  background: linear-gradient(180deg, rgba(5, 10, 22, 1), transparent);
}

.element-wheel::after {
  bottom: 0;
  margin-top: -22px;
  background: linear-gradient(0deg, rgba(5, 10, 22, 1), transparent);
}

.wheel-item {
  scroll-snap-align: center;
  display: grid;
  place-items: center;
  min-height: 104px;
  border: 1px solid rgba(220, 235, 255, 0.12);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  color: var(--text);
  padding: 8px;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease,
    opacity 150ms ease;
}

.wheel-item img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.42));
  pointer-events: none;
}

.wheel-item span {
  display: none;
}

.wheel-item.is-active {
  transform: scale(1.02);
  border-color: rgba(140, 240, 196, 0.72);
  background:
    radial-gradient(circle at 50% 50%, rgba(140, 240, 196, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(110, 168, 255, 0.14), rgba(140, 240, 196, 0.06));
  box-shadow:
    0 0 0 1px rgba(140, 240, 196, 0.14),
    0 14px 28px rgba(0, 0, 0, 0.28);
}

.element-wheel.is-paused {
  border-color: rgba(140, 240, 196, 0.42);
}

.element-wheel.is-locked {
  pointer-events: none;
  opacity: 0.78;
}

.element-wheel.is-locked .wheel-item:not(.is-active) {
  opacity: 0.2;
}

.final-action-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.primary-action,
.generate-action {
  min-width: 170px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(220, 235, 255, 0.22);
  color: var(--text);
  font-weight: 900;
  transition:
    transform 150ms ease,
    opacity 150ms ease,
    box-shadow 150ms ease;
}

.primary-action {
  background:
    linear-gradient(180deg, rgba(110, 168, 255, 0.26), rgba(110, 168, 255, 0.08));
}

.generate-action {
  background:
    linear-gradient(180deg, rgba(140, 240, 196, 0.3), rgba(140, 240, 196, 0.08));
}

.primary-action:hover,
.generate-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3);
}

.primary-action:disabled,
.generate-action:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.selection-status {
  margin: 10px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.viewer-card {
  padding: 18px;
}

.viewer-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.viewer-header h2 {
  margin: 0;
}

.mesh-mode-label {
  color: var(--muted);
  font-size: 0.95rem;
}

.final-canvas-section {
  margin-top: 24px;
}

.final-output-canvas {
  display: block;
  width: 100%;
  min-height: 540px;
  border-radius: 22px;
  border: 1px solid rgba(180, 210, 255, 0.22);
  background:
    radial-gradient(circle at 50% 35%, rgba(30, 64, 175, 0.18), transparent 44%),
    linear-gradient(180deg, #071225, #030916);
}

.visual-art-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(125, 255, 206, 0.28);
  color: #7dffce;
  background: rgba(8, 20, 32, 0.72);
  font-weight: 800;
}

.visual-art-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(8, 13, 24, 0.72);
  color: rgba(226, 232, 240, 0.82);
}

.visual-art-status-bar strong {
  color: var(--accent-3);
}

.hidden-pipeline {
  display: none !important;
}

@media (max-width: 760px) {
  .app {
    padding: 12px;
  }

  .element-selector-card {
    padding: 16px;
  }

  .dual-wheel-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .element-wheel {
    height: 118px;
  }

  .wheel-item {
    min-height: 92px;
  }

  .wheel-item img {
    width: 66px;
    height: 66px;
  }

  .final-action-row {
    flex-direction: column;
  }

  .primary-action,
  .generate-action {
    width: 100%;
  }

  .final-output-canvas {
    min-height: 380px;
  }
}

