/* constructor.css — styles for avatar constructor UI panel */

* {
  box-sizing: border-box;
}

.avatar-constructor-root {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #333;
}

.avatar-constructor-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  padding: 16px;
  max-width: 1000px;
}

/* Canvas preview */
.avatar-canvas-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 16px;
}

.avatar-preview-canvas {
  width: 256px;
  height: 256px;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  border: 3px solid #e0e0e0;
  image-rendering: pixelated;
}

.avatar-username {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-top: 4px;
}

/* Controls panel */
.avatar-controls-wrap {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.avatar-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.avatar-section {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid #e9ecef;
}

.avatar-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #444;
}

/* Variant buttons row */
.variant-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.variant-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  border: 2px solid #dee2e6;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 12px;
  min-width: 64px;
}

.variant-btn:hover {
  border-color: #adb5bd;
  transform: translateY(-1px);
}

.variant-btn.active {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.variant-icon {
  font-size: 22px;
  line-height: 1;
}

.variant-name {
  font-size: 11px;
  color: #666;
  white-space: nowrap;
}

/* Color swatches */
.color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  outline: none;
}

.color-swatch:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-swatch.active {
  border-color: #333;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333;
}

/* Action buttons */
.avatar-actions {
  width: 100%;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.random-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.random-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #5a6fd6 0%, #6a4293 100%);
}

.export-btn {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: #1a3a2a;
}

.export-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #38d96d 0%, #2de9c9 100%);
}

/* Avatar badge (for wall/leaderboard) */
.avatar-badge {
  display: inline-block;
  vertical-align: middle;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Wall demo section */
.wall-demo {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 16px;
}

.wall-demo h2 {
  font-size: 22px;
  margin-bottom: 16px;
  color: #444;
}

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

.wall-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e9ecef;
}

.wall-card-name {
  font-weight: 600;
  font-size: 14px;
}

.wall-card-score {
  font-size: 12px;
  color: #888;
  margin-left: auto;
}

/* Section tabs */
.section-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 16px;
}

.section-tab {
  padding: 10px 20px;
  border: 2px solid #dee2e6;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  transition: all 0.15s;
}

.section-tab:hover {
  border-color: #adb5bd;
}

.section-tab.active {
  border-color: #3b82f6;
  color: #3b82f6;
  background: #eff6ff;
}

/* Custom color picker */
.custom-picker-wrap {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
}

.custom-picker-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px dashed #ccc;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}

.custom-picker-label:hover {
  border-color: #3b82f6;
  transform: scale(1.1);
}

.has-custom .custom-picker-label {
  border-style: solid;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.custom-color-picker {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  top: 0;
  left: 0;
}

/* Responsive */
@media (max-width: 640px) {
  .avatar-constructor-layout {
    flex-direction: column;
    align-items: center;
  }
  .avatar-canvas-wrap {
    position: static;
  }
  .controls-wrap {
    width: 100%;
  }
}
