@import url('https://fonts.googleapis.com/css2?family=Orbitron&family=Monoton&family=Unbounded&family=VT323&family=Press+Start+2P&display=swap');

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #111;
  color: #0f0;
  font-family: monospace, monospace;
  display: flex;
  height: 100vh;
}

#container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

aside#controls {
  width: 320px;
  min-width: 240px;
  background: #222;
  padding: 20px;
  overflow-y: auto;
  border-right: 1px solid #0f0;
}

aside#controls h2,
aside#controls h3 {
  margin-top: 0;
  font-family: 'Orbitron', monospace;
  color: #0f0;
  text-shadow: 0 0 5px #0f0;
}

aside#controls label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

aside#controls input[type="range"],
aside#controls input[type="color"],
aside#controls input[type="text"],
aside#controls select {
  margin-left: 12px;
  flex-shrink: 0;
  width: 130px;
  background: #111;
  border: 1px solid #0f0;
  border-radius: 4px;
  color: #0f0;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 1rem;
}

aside#controls input[type="text"] {
  width: 100%;
  margin-left: 0;
  margin-top: 6px;
}

aside#controls button {
  margin-top: 15px;
  width: 100%;
  padding: 10px;
  background: #0f0;
  border: none;
  color: #111;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}

aside#controls button:hover {
  background: #0cff87;
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background: #000;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}

canvas#canvas {
  border: 1px solid #0f0;
  box-shadow: 0 0 15px #0f0;
  cursor: grab;
  user-select: none;
  background: black;
  object-fit: contain;
}


select.font-preview option {
  font-size: 16px;
  padding: 4px;
}
@media (max-width: 768px) {
  aside#controls {
    position: absolute;
    top: 10px;
    left: 10px;
    right: auto;
    width: 160px; /* half of 320px */
    min-width: unset;
    max-height: 80vh;
    background: rgba(34, 34, 34, 0.95);
    padding: 10px;
    border: 1px solid #0f0;
    border-radius: 10px;
    z-index: 1000;
    box-shadow: 0 0 10px #0f0;
    font-size: 0.7rem;
    overflow-y: auto;
  }

  aside#controls h2,
  aside#controls h3 {
    font-size: 0.9rem;
  }

  aside#controls label {
    font-size: 0.65rem;
    flex-direction: column;
    align-items: flex-start;
    margin: 6px 0;
  }

  aside#controls input[type="range"],
  aside#controls input[type="color"],
  aside#controls input[type="text"],
  aside#controls select {
    width: 100%;
    font-size: 0.7rem;
    padding: 1px 4px;
  }

  aside#controls button {
    font-size: 0.8rem;
    padding: 6px;
    margin-top: 10px;
  }

  body,
  #container {
    flex-direction: column;
  }
}
