/* Theme variables */
:root {
  --ink: #0e1822;
  --bg: #f6f7f7;
  --muted: #eaecee;
  --accent: #6b85ff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.2;
  height: 100vh;
  overflow: hidden;
}

/* Layout */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: 100%;
}

/* Sidebar */
.sidebar {
  background: #fff;
  border-right: 1px solid var(--muted);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font-size: 14px;
  text-align: left;
}

.side-item .icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: currentColor;
  flex-shrink: 0;
}

.side-item:hover {
  background: #f5f7f8;
}

.side-item.active {
  background: #eef3ff;
  color: var(--accent);
}

/* Stage */
.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* Circle containing the avatar preview. */
/* The circular stage around the avatar. Its size is based on the
   pixel grid (64) times the current scale (10) plus some margin. */
.circle {
  width: calc(64 * 10px + 40px);
  height: calc(64 * 10px + 40px);
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Subtle shadow to lift the avatar off the page without a visible ring */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* The avatar canvas inside the circular stage. It fills most of the circle
   leaving a small margin. We explicitly avoid a drop shadow here to remove
   the white ring the user disliked. */
.circle canvas {
  width: calc(64 * 10px);
  height: calc(64 * 10px);
  border-radius: 50%;
  background: #fff;
  box-shadow: none;
}

.controls {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  gap: 12px;
}

button.primary,
button.secondary {
  border: none;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

button.primary {
  background: var(--ink);
  color: #fff;
}

button.secondary {
  background: #fff;
  border: 1px solid var(--muted);
  color: var(--ink);
}

/* Options panel */
.panel {
  position: absolute;
  top: 80px;
  right: 24px;
  width: 320px;
  background: #fff;
  border: 1px solid var(--muted);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.06);
  overflow-y: auto;
  max-height: calc(100% - 100px);
}

.panel-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.section {
  margin-top: 12px;
}

.section-title {
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 8px;
}

.chip {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--muted);
  background: #fff;
  cursor: pointer;
  margin-right: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.chip.active {
  border-color: var(--accent);
  background: #eef3ff;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--muted);
  cursor: pointer;
}

.swatch.active {
  box-shadow: 0 0 0 2px var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.grid-item {
  height: 56px;
  border: 1px solid var(--muted);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-item.active {
  border-color: var(--accent);
  background: #eef3ff;
}

/* Option preview inside grid items. Shows a small pixelated icon and a label. */
.grid-item .option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
}

.grid-item .option img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
}

.grid-item .option-name {
  font-size: 11px;
  color: var(--ink);
  line-height: 1;
}