/* CRTPainter — retro dark-room theme, self-contained (no external fonts/CDNs) */

:root {
  --bg: #050607;
  --bg-panel: #0b0d0e;
  --phosphor: #33ff88;
  --phosphor-dim: #1c8f52;
  --phosphor-glow: rgba(51, 255, 136, 0.55);
  --text: #d7ffe8;
  --mono: "Courier New", Courier, monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #0a0c0d 0%, #050607 60%, #000000 100%);
  color: var(--text);
  font-family: var(--mono);
}

.stage {
  width: 100%;
  max-width: 960px;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* ---------- Drop zone ---------- */

#drop {
  position: relative;
  width: 100%;
  max-width: 640px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  border: 3px dashed var(--phosphor-dim);
  border-radius: 10px;
  background: rgba(51, 255, 136, 0.03);
  color: var(--phosphor);
  font-family: var(--mono);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

#drop:hover,
#drop:focus-within {
  border-color: var(--phosphor);
  background: rgba(51, 255, 136, 0.06);
  box-shadow: 0 0 24px rgba(51, 255, 136, 0.15) inset;
}

#drop.dragover {
  border-color: var(--phosphor);
  background: rgba(51, 255, 136, 0.12);
  box-shadow: 0 0 32px rgba(51, 255, 136, 0.3) inset;
}

#drop .drop-text {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.03em;
  text-shadow: 0 0 8px var(--phosphor-glow);
  pointer-events: none;
}

#drop #file {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* ---------- Painting canvas ---------- */

.paint-wrap {
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#paint {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

/* ---------- Control bar ---------- */

.controls {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 14px 20px;
  border: 1px solid var(--phosphor-dim);
  border-radius: 10px;
  background: var(--bg-panel);
  box-shadow: 0 0 20px rgba(51, 255, 136, 0.05) inset;
}

.control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.control-label {
  color: var(--phosphor);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: 0 0 6px var(--phosphor-glow);
  white-space: nowrap;
}

.control-checkbox {
  cursor: pointer;
}

/* Range inputs */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 4px;
  background: var(--phosphor-dim);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--phosphor);
  box-shadow: 0 0 8px var(--phosphor-glow);
  border: none;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--phosphor);
  box-shadow: 0 0 8px var(--phosphor-glow);
  border: none;
  cursor: pointer;
}

input[type="range"]::-moz-range-track {
  height: 4px;
  background: var(--phosphor-dim);
  border-radius: 2px;
}

/* Checkbox */

input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--phosphor-dim);
  border-radius: 3px;
  background: #000;
  cursor: pointer;
  position: relative;
}

input[type="checkbox"]:checked {
  background: var(--phosphor);
  border-color: var(--phosphor);
  box-shadow: 0 0 8px var(--phosphor-glow);
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0px;
  width: 4px;
  height: 8px;
  border: solid #000;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Buttons */

button {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--phosphor);
  background: #0a0c0c;
  border: 1px solid var(--phosphor-dim);
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
  text-shadow: 0 0 6px var(--phosphor-glow);
}

button:hover {
  border-color: var(--phosphor);
  box-shadow: 0 0 12px rgba(51, 255, 136, 0.35);
  background: rgba(51, 255, 136, 0.08);
}

button:active {
  background: rgba(51, 255, 136, 0.18);
}

/* Status */

#status {
  color: var(--phosphor);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-shadow: 0 0 6px var(--phosphor-glow);
  min-width: 60px;
  text-align: center;
}

/* ---------- Small screens ---------- */

@media (max-width: 480px) {
  .controls {
    gap: 12px;
    padding: 12px;
  }

  input[type="range"] {
    width: 80px;
  }
}
