/* ── pixel-art.css — Avatar drawing tool styles ── */

.pixel-art-card {
  background: var(--pixel-card-bg); border-radius: 0; padding: 28px 28px 24px;
  width: 100%; max-width: 620px; margin: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
}
.pixel-canvas-wrap {
  display: flex; justify-content: center; margin: 16px 0;
  touch-action: none;
}
#pixel-canvas {
  cursor: none; outline: 1.5px solid var(--border); border-radius: 0;
  width: 100%; max-width: 560px; height: auto;
  will-change: contents;
  image-rendering: auto;
  display: block;
}
#pixel-cursor {
  position: fixed; pointer-events: none; border-radius: 50%; z-index: 9999;
  border: 1.5px solid rgba(0,0,0,0.6); background: transparent;
  transform: translate(-50%, -50%);
  transition: width .08s, height .08s;
  display: none;
  mix-blend-mode: difference;
  outline: 1px solid rgba(255,255,255,0.4);
}

/* ── Toolbar ── */
.pixel-toolbar {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 12px; margin: 0 auto 14px; width: 100%; max-width: 560px;
}
#pixel-palette {
  display: flex; align-items: center; gap: 6px;
}
.pixel-color-swatch {
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  border: 2.5px solid transparent; transition: transform .1s;
  flex-shrink: 0; box-sizing: border-box;
}
.pixel-color-swatch:hover { transform: scale(1.15); }
.pixel-color-swatch.selected { box-shadow: inset 0 0 0 3px #e8e8e8; }
.pixel-color-swatch.selected.dark-ring { box-shadow: inset 0 0 0 3px #1a1a1a; }

.pixel-tool-btn {
  width: 44px; height: 44px; padding: 0; font-size: 12px; font-family: Inter, system-ui, sans-serif;
  border: 1.5px solid var(--border); border-radius: 0; background: var(--input-bg);
  cursor: pointer; color: var(--text2); transition: background .15s, color .15s, border-color .15s;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  flex-shrink: 0;
}
.pixel-tool-btn:hover { background: var(--btn-ghost-hover); }
.pixel-tool-btn.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.pixel-tool-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pixel-tool-btn span { font-size: 9px; letter-spacing: .04em; }

.pixel-eraser {
  width: 44px; height: 44px; padding: 0; font-size: 12px; font-family: Inter, system-ui, sans-serif;
  border: 1.5px solid var(--border); border-radius: 0; background: var(--input-bg);
  cursor: pointer; color: var(--text2); transition: background .15s, color .15s, border-color .15s;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  flex-shrink: 0;
}
.pixel-eraser svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pixel-eraser span { font-size: 9px; letter-spacing: .04em; }
.pixel-eraser.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.pixel-clear {
  width: 44px; height: 44px; padding: 0; font-size: 12px;
  font-family: Inter, system-ui, sans-serif; border: 1.5px solid var(--border);
  border-radius: 0; background: var(--input-bg); cursor: pointer; color: var(--text3);
  transition: background .15s; flex-shrink: 0;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.pixel-clear:hover { background: var(--btn-ghost-hover); color: var(--text2); }
.pixel-clear svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pixel-clear span { font-size: 9px; letter-spacing: .04em; }

.pixel-toolbar-divider { width: 1px; height: 44px; background: var(--border); flex-shrink: 0; }

/* ── Color wheel button ── */
.color-wheel-btn {
  width: 52px; height: 26px; border-radius: 999px; cursor: pointer; border: 2.5px solid transparent;
  background: linear-gradient(to right, #e05151, #e07c35, #d4a017, #4caf7d, #3b8fd4, #7b61e0, #d45fa3);
  flex-shrink: 0; transition: transform .1s, border-color .1s; position: relative;
}
.color-wheel-btn:hover { transform: scale(1.08); }
.color-wheel-btn.selected { border-color: #e8e8e8; }
.color-wheel-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; border-radius: 999px;
}

/* ── Compact brush controls ── */
.compact-brush-control {
  display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0;
  background: var(--bg3); border: 0.5px solid var(--border2); border-radius: 0;
  padding: 7px 12px 7px;
}
.inline-brush-label {
  font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text3); font-family: Inter, system-ui, sans-serif;
}
.compact-brush-row { display: flex; align-items: center; gap: 4px; }
.compact-brush-val {
  min-width: 42px; text-align: center; font-size: 12px; font-family: Inter, system-ui, sans-serif;
  color: var(--text); cursor: pointer; padding: 2px 4px;
  border-radius: 0; transition: background .12s; border: 1px solid transparent;
}
.compact-brush-val:hover { background: var(--btn-ghost-hover); border-color: var(--border2); }
.inline-step-btn {
  width: 24px; height: 24px; background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 0; cursor: pointer; font-size: 14px; color: var(--text2);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: Inter, system-ui, sans-serif; transition: background .12s, color .12s; flex-shrink: 0;
  line-height: 1;
}
.inline-step-btn:hover { background: var(--btn-ghost-hover); color: var(--text); }

/* ── Mobile toolbar fixes ── */
@media (max-width: 600px) {
  .pixel-toolbar {
    align-items: center;
  }
  .pixel-toolbar > div {
    justify-content: center;
    width: 100%;
  }
  #pixel-palette {
    flex-wrap: wrap;
    justify-content: center;
  }
  .advanced-sliders {
    max-width: 100%;
  }
}

/* ── Advanced slider row ── */
.advanced-sliders {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--input-bg); border: 1px solid var(--border2);
  border-radius: 0; padding: 10px 14px; margin: 0 auto 6px; width: 100%; max-width: 560px;
  box-sizing: border-box; animation: fadeSlide .15s ease;
}
.advanced-slider-block { display: flex; align-items: center; gap: 12px; }
.advanced-slider-block .inline-brush-label { min-width: 50px; }
.inline-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px; background: var(--border2); outline: none; cursor: pointer;
}
.inline-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 0;
  background: var(--text); cursor: pointer; border: 2px solid var(--input-bg);
  box-shadow: 0 0 0 1px var(--text);
}
.inline-slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 0;
  background: var(--text); cursor: pointer; border: 2px solid var(--input-bg);
  box-shadow: 0 0 0 1px var(--text);
}
