html, body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}

body {
  background: #2a2a2a;
  font-family: Arial, sans-serif;
  color: #e4da5f;
}

.container {
  flex: 1;
  max-width: 900px;
  width: 100%;
  text-align: center;
  margin: auto;
}

h1 {
  margin-bottom: 20px;
  color: #5fcde4;
}

.menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

input, select {
  background: #2a2a2a;
  color: #e4da5f;
  border: 1px solid #5fcde4;
  padding: 2px 5px;
}

button {
  padding: 5px 10px;
  cursor: pointer;
  background: #5fcde4;
  color: #2a2a2a;
  font-weight: bold;
  border: none;
  border-radius: 4px;
}

button:hover {
  background: #4bb1c7;
}

.canvas-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border: 2px solid #e4da5f;
  background: #ccc;
  height: 400px;
  margin: auto;
  position: relative;
  cursor: grab;
}

.canvas-wrapper.dragging {
  cursor: grabbing;
}

.canvas {
  display: grid;
  transform-origin: center center;
  position: absolute;
  top: 50%;
  left: 50%;
}

.pixel {
  width: 20px;
  height: 20px;
  background: white;
  border: 1px solid black;
  cursor: pointer;
}

.output-dual {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
}

.output-section {
  flex: 1;
  text-align: center;
}

pre {
  background: #111;
  padding: 10px;
  border-radius: 4px;
  color: #e4da5f;
  max-height: 300px;
  overflow-y: auto;
}

.footer {
  background: black;
  text-align: center;
  padding: 10px 0;
}

.footer a {
  color: #5fcde4;
  font-weight: bold;
  text-decoration: none;
}

.footer a:hover {
  color: #e4da5f;
}

#invertColors {
  background: #ac3232;
  color: #ffffff;
}

#invertColors:hover {
  background: #8c2525;
}

/* ------ AJUSTES PARA MÓVILES ------ */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  h1 {
    font-size: 1.2rem;
  }

  .menu-row {
    flex-wrap: wrap;
    justify-content: center;
  }

  input, select, button {
    font-size: 0.9rem;
    padding: 4px 6px;
  }

  .canvas-wrapper {
    height: 300px;
    width: 100%;
  }

  .pixel {
    width: 16px;
    height: 16px;
  }

  pre {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .canvas-wrapper {
    height: 250px;
  }

  .pixel {
    width: 14px;
    height: 14px;
  }
}
