:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --border: #d4dce2;
  --text: #1d2a33;
  --muted: #5f7382;
  --accent: #8c1d40;
}

@font-face {
  font-family: "Zurich Extra Condensed Regular";
  src: url("fonts/Zurich Extra Condensed Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  /* background: radial-gradient(circle at top left, #ffffff 0%, var(--bg) 45%); */
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 340px 1fr;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(23, 38, 51, 0.08);
}

.controls {
  padding: 1rem;
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

h1 {
  margin: 0;
  font-size: 1.35rem;
}

.subtitle {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

label {
  font-size: 0.9rem;
  font-weight: 600;
}

.color-options {
  margin: 0;
  padding: 0;
  border: 0;
}

.color-options legend {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.4rem;
}

.color-grid-text {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.color-option {
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem;
  cursor: pointer;
  min-height: 2.1rem;
  position: relative;
}

.color-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.swatch {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.color-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.color-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

input[type="text"],
input[type="file"],
input[type="color"],
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem;
  font: inherit;
}

input[type="color"] {
  min-height: 44px;
  padding: 0.3rem;
}

.actions {
  margin-top: 0.75rem;
}

button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

button:hover {
  filter: brightness(1.05);
}

.share-panel {
  margin-top: 0.5rem;
}

.share-title {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.share-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.share-btn {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
  padding: 0.5rem 0.45rem;
}

.share-btn:hover {
  filter: none;
  border-color: var(--accent);
}

.preview {
  padding: 1rem;
  display: grid;
  place-items: center;
}

#plateCanvas {
  width: 100%;
  max-width: 820px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fff;
}

@media (max-width: 920px) {
  .app {
    grid-template-columns: 1fr;
  }

  .controls {
    order: 2;
  }

  .preview {
    order: 1;
  }

  .share-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
