body {
 margin: 0;
 /* cursor: none; Oculta el cursor del ratón */
}

.background {
 position: relative;
 top: 0;
 left: 0;
 width: 100%;
 height: 100%;
 z-index: 1;
 /* Ensure background is behind overlay */
}


#menu {
  padding: 16px 20px 18px;
  min-width: 230px;
  font-family: Arial, sans-serif;
  background-color: #f0f0f0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  z-index: 2;
}

/* Section dividers */
.menu-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 4px;
  font-size: 10px;
  font-family: monospace;
  color: #888;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.menu-divider::before,
.menu-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #ccc;
}

/* Join row */
#join-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

#join-code-input {
  flex: 1;
  padding: 7px 10px;
  font-size: 14px;
  font-family: monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid #ccc;
  border-radius: 5px;
  outline: none;
  background: #fff;
}
#join-code-input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.2);
}

#btn-join-room {
  width: auto;
  padding: 7px 14px;
  margin: 0;
  font-size: 14px;
  background-color: #007bff;
}

#join-error {
  display: block;
  font-size: 11px;
  color: #c00;
  min-height: 14px;
  margin-top: 3px;
  font-family: monospace;
}

#btn-create-room {
  background-color: #17a2b8;
}
#btn-create-room:hover {
  background-color: #117a8b;
}

#btn-solo {
  background-color: #28a745;
}
#btn-solo:hover {
  background-color: #1e7e34;
}

h1 {
 font-size: 2em;
 margin-bottom: 20px;
}

label {
 text-align: center;
 display: block;
 margin-bottom: 10px;
}

button {
  width: 100%;
  font-size: 1em;
  padding: 8px 0;
  margin-top: 6px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #0056b3;
}

#btn-preview {
  background-color: #6f42c1;
}
#btn-preview:hover {
  background-color: #59339d;
}

/* ── Map preview overlay ──────────────────────────────────────────────────── */
#map-preview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 100;
  justify-content: center;
  align-items: center;
}

#map-preview-box {
  background: #1a1a2e;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 16px;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
}

#map-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #eee;
  font-family: monospace;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#map-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#btn-new-map {
  width: auto;
  padding: 4px 12px;
  margin: 0;
  font-size: 12px;
  background-color: #28a745;
  font-family: monospace;
  letter-spacing: 0.04em;
}
#btn-new-map:hover {
  background-color: #1e7e34;
}

#map-preview-close {
  width: auto;
  background: transparent;
  color: #aaa;
  font-size: 18px;
  padding: 0 6px;
  margin: 0;
  line-height: 1;
}
#map-preview-close:hover {
  background: transparent;
  color: #fff;
}

#map-preview-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: monospace;
  font-size: 12px;
  flex-wrap: wrap;
}
.legend-wall  { color: #c0724a; }
.legend-bush  { color: #4aaa4a; }
.legend-floor { color: #a8d8a8; }
.legend-spawn { color: #00cfff; }
.legend-star  { color: #ffd700; }

#ghost-count-control {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: #b8aaff;
  font-family: monospace;
  font-size: 12px;
}

#ghost-count-value {
  min-width: 14px;
  text-align: center;
  font-weight: bold;
  color: #fff;
}

.ghost-count-btn {
  width: auto;
  padding: 1px 8px;
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  background: rgba(120, 100, 220, 0.4);
  border: 1px solid rgba(180, 160, 255, 0.4);
  border-radius: 4px;
  color: #ddd;
}
.ghost-count-btn:hover {
  background: rgba(120, 100, 220, 0.7);
}

#map-preview-canvas {
  display: block;
  border-radius: 4px;
  image-rendering: pixelated;
}