:root {
  --bg: #1a1a1a;
  --panel: #2a2a2a;
  --muted: #999;
  --border: #3a3a3a;
  --border-light: #555;
  --text: #e0e0e0;
  --green: #39ff14;
  --yellow: #ffff66;
  --green-glow: rgba(57, 255, 20, 0.1);
  --yellow-bright: #ffff99;
}
* {
  box-sizing: border-box;
  font-family: "Source Code Pro", monospace;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
header h1 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}
main {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
}
.controls {
  flex: 1;
  min-width: 300px;
  max-width: 600px;
  max-height: 750px;
  overflow-y: scroll;
}
.controls::-webkit-scrollbar {
  width: 12px;
}
.controls::-webkit-scrollbar-track {
  background: var(--bg);
}
.controls::-webkit-scrollbar-thumb {
  background: var(--green);
  border-radius: 0;
}
.controls::-webkit-scrollbar-thumb:hover {
  background: #66ff44;
}
.panel {
  background: var(--panel);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.panel h2 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: var(--text);
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
input[type="file"] {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  color: var(--green);
  border: 2px solid var(--green);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
input[type="file"]::-webkit-file-upload-button,
input[type="file"]::file-selector-button {
  background: transparent;
  color: var(--green);
  border: none;
  border-right: 1px solid var(--green);
  padding: 4px 12px 4px 8px;
  margin-right: 12px;
  cursor: pointer;
  font-family: "Source Code Pro", monospace;
}
input[type="file"]:hover {
  background: var(--green-glow);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}
input[type="file"].flicker {
  animation: flicker 1.5s ease-in-out infinite;
}
@keyframes flicker {
  0%,
  100% {
    outline: 4px solid transparent;
  }
  50% {
    outline: 4px solid #ffffff;
    outline-offset: 2px;
  }
}
.bg-options {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (max-width: 1600px) {
  .bg-options {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1400px) {
  .bg-options {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1200px) {
  .bg-options {
    grid-template-columns: repeat(2, 1fr);
  }
}
.bg-options li {
  display: flex;
}
.bg-options label {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  background: #4a4a5a;
  transition: all 0.2s;
}
.bg-options label:hover {
  border-color: var(--green);
}
.bg-options input[type="radio"] {
  display: none;
}
.bg-options label:has(input[type="radio"]:checked) {
  border-color: var(--green);
  background: #5a6a5a;
}
.bg-options img {
  max-width: 100%;
  height: 80px;
  object-fit: contain;
}

.canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#preview {
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: default;
}
#preview.can-drag {
  cursor: move;
}
.help {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}
a {
  color: var(--green);
  text-decoration: underline;
}
button,
input[type="range"] {
  cursor: pointer;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: var(--border-light);
  height: 4px;
  border-radius: 2px;
}
input[type="range"]::-webkit-slider-track {
  background: var(--border-light);
  height: 4px;
  border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  cursor: pointer;
  border: 2px solid var(--green);
}
input[type="range"]::-webkit-slider-thumb:hover {
  background: #66ff44;
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
}
input[type="range"]::-moz-range-track {
  background: var(--border-light);
  height: 4px;
  border-radius: 2px;
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  cursor: pointer;
  border: 2px solid var(--green);
}
input[type="range"]::-moz-range-thumb:hover {
  background: #66ff44;
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
}
button {
  background: transparent;
  color: var(--green);
  border: 2px solid var(--green);
  padding: 8px 12px;
  border-radius: 4px;
  transition: all 0.2s;
}
button:hover {
  background: var(--green-glow);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}

@media (max-width: 900px) and (pointer: coarse) {
  header,
  main,
  footer {
    display: none !important;
  }

  body::before {
    content: "Open on a desktop computer to create digital AoC merch";
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-size: 20px;
    text-align: center;
    padding: 20px;
    color: var(--text);
  }
}
