/* Fuente base y layout */
:root{
  --azul:#1e40af;
  --azul-oscuro:#1b398f;
  --gris-fondo:#f3f4f6;
  --borde:#e5e7eb;
  --verde-libre:#b2f2bb;
  --amarillo:#fde047;
  --rojo:#ef4444;
  --celeste:#3b82f6;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--gris-fondo);
  color:#111827;
  display:flex;
  align-items: center;
  justify-content: center;
}

.container{
  width: min(1100px, 95vw);
  margin: 24px auto;
  background: #fff;
  border:1px solid var(--borde);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.05);
}

.header{
  text-align:center;
  margin-bottom: 8px;
}
.header h1{
  margin: 8px 0 6px;
  font-size: clamp(1.2rem, 3.2vw, 1.8rem);
}
.header p{margin: 4px 0;}

/* Leyenda */
.legend{
  display:flex;
  flex-wrap: wrap;
  gap:10px 18px;
  align-items:center;
  justify-content:center;
  margin: 10px 0 6px;
}
.legend-item{display:flex; align-items:center; gap:8px; font-size:.95rem}
.dot{
  width:16px; height:16px; border-radius:50%; border:1px solid #0001; display:inline-block;
}
.dot.libre{ background: var(--verde-libre); }
.dot.seleccionado{ background: var(--celeste); }
.dot.reservado{ background: var(--amarillo); }
.dot.ocupado{ background: var(--rojo); }

.controls, .actions{
  display:flex; align-items:center; justify-content:center; gap:12px; margin: 6px 0 10px;
}

/* Botones */
.btn{
  background:#e5e7eb;
  color:#111827;
  border:none;
  padding:10px 16px;
  border-radius:12px;
  cursor:pointer;
  font-weight:bold;
  transition: transform .02s ease, background .2s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn.primary{
  background: var(--azul);
  color:#fff;
}
.btn.primary:hover{ background: var(--azul-oscuro); }

/* Grilla 10x10 */
.grid-wrapper{ display:flex; justify-content:center; margin: 4px 0 10px; }
.grid{
  display:grid;
  grid-template-columns: repeat(10, minmax(32px, 1fr));
  gap:6px;
  width:min(680px, 100%);
}
.celda{
  display:flex; align-items:center; justify-content:center;
  aspect-ratio:1/1;
  border:1px solid var(--borde);
  border-radius:12px;
  font-weight:bold;
  user-select:none;
  transition: transform .03s ease, box-shadow .2s ease;
  background:#fff;
}
.celda:focus{ outline: 2px solid #93c5fd; outline-offset:2px; }
.celda:hover{ box-shadow: 0 6px 16px rgba(0,0,0,.06); transform: translateY(-1px); }

/* Estados */
.celda.libre{ background: var(--verde-libre); color:#111827;}
.celda.seleccionado{ background: var(--celeste); color:#fff;}
.celda.reservado{ background: var(--amarillo); color:#111827; cursor:not-allowed; }
.celda.ocupado{ background: var(--rojo); color:#fff; cursor:not-allowed; }

/* Responsivo */
@media (max-width: 520px){
  .grid{ gap:5px; }
  .celda{ border-radius:10px; }
}
