:root {
  --bg: #ffd900;
  --c1: #ffea74;
  --c2: #d18c14;
  --text-dark: #000;
  --text-light: #fff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-dark);
  font-family: Inter, sans-serif;
  text-align: center;
}

header { padding: 2rem 1rem 1rem; }

.title {
  font-family: Bungee, Inter, sans-serif;
  font-size: 2rem;
  margin: 0;
}

.subtitle {
  font-size: 1rem;
  opacity: 0.8;
  margin: 0.3rem 0 2rem;
}

.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  padding: 0 1rem 2rem;
}

.preview {
  flex: 1 1 360px;
  max-width: 420px;
  position: relative;
}

canvas {
  width: 100%;
  height: auto;
  background: #fff8cc;
  border: 3px solid var(--c2);
  border-radius: 12px;
  box-shadow: 0 8px 0 #00000020;
}

.buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

.btn {
  flex: 1;
  margin: 0 4px;
  padding: 10px 12px;
  font-family: Bungee;
  background: var(--c1);
  color: var(--text-dark);
  border: 2px solid #000;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.btn.primary { background: var(--c2); color: var(--text-light); }
.btn:hover { transform: translateY(-2px); }

.controls {
  flex: 1 1 480px;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: stretch;
}

.layer-group {
  background: #fff8cc;
  border: 3px solid var(--c2);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 6px 0 #00000015;
}

.layer-group h2 {
  font-family: Bungee;
  margin: 0 0 0.5rem;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 10px;
}

.thumbs img {
  width: 100%;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
}
.thumbs img:hover,
.thumbs img.active {
  border-color: var(--c2);
  transform: scale(1.03);
}

footer {
  padding: 1rem;
  font-size: 0.9rem;
  opacity: 0.7;
}

@media (max-width: 600px) {
  .title { font-size: 1.6rem; }
  .layer-group h2 { font-size: 1.1rem; }
}
