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

body {
  background: #1c1c1c;
  color: #f0f0f0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 48px;
}

/* ── Main layout ── */

main {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

/* ── Plate SVG ── */

.plate-container {
  width: 100%;
  max-width: 350px;
  aspect-ratio: 1 / 1;
}

.plate-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: grab;
}

.plate-container canvas:active {
  cursor: grabbing;
}

/* ── Color pickers ── */

.pickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
}

.picker-tabs {
  display: none;
}

.picker-section {
  background: #252525;
  border-radius: 14px;
  padding: 20px;
}

.picker-desktop-heading {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 16px;
}

.swatch-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

/* ── Filament type groups ── */

.swatch-type-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.swatch-type-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.swatch-type-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #555;
  font-size: 0.5rem;
  font-weight: 700;
  font-style: italic;
  color: #777;
  cursor: default;
  position: relative;
}

.info-icon:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #ddd;
  font-style: normal;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  max-width: 220px;
  white-space: normal;
  line-height: 1.4;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

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

.swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.12);
  padding: 0;
  background: none;
  transition: transform 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease;
  flex-shrink: 0;
}

.swatch:hover {
  transform: scale(1.18);
  border-color: rgba(255, 255, 255, 0.5);
}

.swatch.selected {
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

/* ── Silk shimmer effect ── */

.swatch-silk {
  background-image: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0)   0%,
    rgba(255, 255, 255, 0.35) 45%,
    rgba(255, 255, 255, 0)   55%,
    rgba(255, 255, 255, 0.15) 80%,
    rgba(255, 255, 255, 0)   100%
  ) !important;
  background-blend-mode: screen;
}

.color-label {
  min-height: 2.8em;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.color-label .color-type {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666;
}

.color-label .color-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f0f0f0;
}

/* ── Copy button ── */

.copy-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.copy-button {
  background: #f0f0f0;
  color: #1c1c1c;
  border: none;
  border-radius: 8px;
  padding: 13px 36px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.copy-button:hover {
  background: #d8d8d8;
}

.copy-button:active {
  transform: scale(0.97);
}

.copy-feedback {
  font-size: 0.72rem;
  color: #888;
  height: 1em;
}

/* ── Responsive ── */

@media (max-width: 460px) {
  body {
    padding: 16px 12px 32px;
  }

  main {
    gap: 20px;
  }

  .plate-container {
    max-width: 240px;
  }

  .pickers {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Show tabs, hide desktop headings */
  .picker-tabs {
    display: flex;
    gap: 0;
    width: 100%;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
  }

  .picker-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: #1f1f1f;
    color: #666;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }

  .picker-tab.active {
    background: #252525;
    color: #f0f0f0;
  }

  .picker-desktop-heading {
    display: none;
  }

  .picker-section {
    display: none;
    border-radius: 0 0 14px 14px;
    padding: 16px;
  }

  .picker-section.tab-active {
    display: block;
  }

  /* Compact swatches */
  .swatch-grid {
    gap: 10px;
    margin-bottom: 10px;
  }

  .swatch-type-group {
    gap: 5px;
  }

  .swatch {
    width: 30px;
    height: 30px;
  }

  .swatch-row {
    gap: 6px;
  }
}
