* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #f4f4f4;
  color: #222;
  margin: 0;
  padding: 0 16px 60px;
}
header {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 0 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.site-logo { max-height: 44px; max-width: 200px; object-fit: contain; }
h1 { margin: 0 0 4px; font-size: 28px; }
.sub { color: #555; margin: 0 0 12px; }
.stats {
  display: flex;
  gap: 24px;
  font-size: 14px;
  color: #333;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.stats b { color: #000; }

#gridWrap {
  max-width: 1000px;
  margin: 0 auto;
  border: 2px solid #333;
  background: #fff;
  overflow: auto;
}
canvas {
  display: block;
  cursor: crosshair;
  width: 100%;
  height: auto;
}

#selectionBar {
  max-width: 1000px;
  margin: 10px auto 0;
  display: none;
  background: #111;
  color: #fff;
  padding: 12px 16px;
  border-radius: 6px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
#selectionBar button {
  background: #ffcc00;
  border: none;
  padding: 8px 18px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}
#selectionBar button:hover { background: #ffd633; }

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 8px;
  max-width: 420px;
  width: 100%;
  padding: 24px;
}
.modal h2 { margin-top: 0; }
.modal label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
.modal input[type=text], .modal input[type=email], .modal input[type=file] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}
.modal .price { font-size: 20px; font-weight: 700; margin-top: 10px; }
.modal .actions { display: flex; gap: 10px; margin-top: 18px; }
.modal button {
  flex: 1;
  padding: 10px;
  border-radius: 4px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}
.modal .buy { background: #111; color: #fff; }
.modal .cancel { background: #eee; }
.error { color: #c0392b; font-size: 13px; margin-top: 8px; min-height: 16px; }

footer {
  max-width: 1000px;
  margin: 20px auto 0;
  font-size: 12px;
  color: #888;
  text-align: center;
}
