/* Laboratorio de Colores · taller.css
   Taller de mezcla (fase 2). Referencia visual: la maqueta aprobada.
   Ordenador (> 1024 px): paleta a la izquierda, recipiente en el centro, resultado a la derecha.
   Tablet y móvil: recipiente arriba, resultado debajo y paleta fija abajo, al alcance del pulgar. */

body.taller { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- Cabecera ---------- */
.barra {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: var(--mesa); border-bottom: 1px solid var(--borde);
}
.barra-marca { display: flex; align-items: center; gap: 10px; }
.logo { width: 38px; height: 38px; flex: none; }
.barra h1 { font-size: clamp(19px, 2.6vw, 24px); font-weight: 900; }
.modo { flex: none; padding: 8px 14px; border-radius: 14px; background: var(--tinta); color: #FFFFFF; font-weight: 800; font-size: 15px; }

/* ---------- Rejilla principal ---------- */
.rejilla {
  flex: 1; display: grid; gap: 14px; padding: 14px 14px 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "mesa" "resultado" "paleta";
}
.paleta { grid-area: paleta; }
.mesa { grid-area: mesa; }
.resultado { grid-area: resultado; }

.paleta, .mesa, .resultado { background: var(--mesa); border-radius: var(--radio); box-shadow: 0 1px 0 var(--borde); }
.titulo-zona { font-size: 18px; font-weight: 900; }

/* ---------- Paleta ---------- */
.paleta {
  position: sticky; bottom: 0; z-index: 2;
  margin: 0 -14px; border-radius: 26px 26px 0 0;
  padding: 10px max(10px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  box-shadow: 0 -2px 12px rgba(31, 36, 48, 0.08);
}
.paleta .titulo-zona { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.botes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.bote {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 84px; padding: 6px 2px; border-radius: 18px;
  border: 2px solid transparent; background: #FBFAF8;
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform 80ms ease;
}
.bote:active:not(:disabled) { transform: scale(0.95); }
.bote:disabled { opacity: 0.45; cursor: not-allowed; }
.bote.usado { border-color: var(--pintura); background: color-mix(in srgb, var(--pintura) 12%, #FFFFFF); }
.bote[data-pigmento="blanco"].usado { border-color: #CFC8BC; background: #FFFFFF; }
.bote-mancha { width: 46px; height: 46px; flex: none; }
.bote-nombre { font-size: 13px; font-weight: 800; line-height: 1.1; }
.bote-cuenta {
  position: absolute; top: -6px; right: -2px;
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px;
  background: var(--tinta); color: #FFFFFF; font-size: 14px; font-weight: 900;
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.bote-cuenta[hidden] { display: none; }
.ayuda { margin: 8px 0 0; text-align: center; font-size: 14px; font-weight: 700; color: var(--tinta-suave); }

/* ---------- Recipiente ---------- */
.mesa { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 14px 16px; }
.recipiente { width: 100%; display: flex; justify-content: center; }
.cuenco { width: 100%; max-width: 520px; height: auto; max-height: 36vh; max-height: 36dvh; }
.cuenco-vacio { font: 800 24px Nunito, system-ui, sans-serif; fill: #9A9285; }
.pintura-cuerpo, .superficie-color { transition: fill 0.35s ease; }

.gotas-zona { display: grid; justify-items: center; gap: 6px; width: 100%; }
.fila-gotas { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 7px; max-width: 420px; min-height: 0; }
.gota-fila, .gota-receta {
  width: 20px; height: 20px; flex: none;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--pintura); box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.12), 0 0 0 1.5px rgba(31, 36, 48, 0.18);
}
.gota-clara { box-shadow: 0 0 0 2px #CFC8BC; }
.contador { margin: 0; font-weight: 800; font-size: 16px; color: var(--tinta-suave); font-variant-numeric: tabular-nums; }

.acciones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 420px; }
.acciones .boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 14px; touch-action: manipulation; }
.acciones svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.boton-claro { background: #FFFFFF; color: var(--tinta); }
.boton-vaciar { background: var(--rojo-boton); border-color: var(--rojo-boton); color: #FFFFFF; font-weight: 900; }
.boton:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Resultado ---------- */
.resultado { padding: 16px; display: grid; gap: 14px; align-content: start; }
.resultado .titulo-zona { display: none; }
.resultado-cabeza { display: flex; align-items: center; gap: 14px; }
.muestra-resultado { width: 84px; height: 74px; flex: none; background: var(--color, transparent); }
.muestra-resultado.vacia { background: var(--hueco); box-shadow: inset 0 0 0 3px var(--borde); }
.nombre-color { margin: 0; font-size: clamp(22px, 5vw, 30px); font-weight: 900; line-height: 1.05; letter-spacing: -0.01em; }
.nota-nombre { margin: 4px 0 0; font-size: 13px; font-weight: 700; color: var(--tinta-suave); }
.nota-nombre:empty, .hex-color:empty { display: none; }
.hex-color { margin: 2px 0 0; font-size: 13px; color: var(--tinta-suave); font-variant-numeric: tabular-nums; }

.receta-zona { border-top: 1px solid #EFEAE2; padding-top: 12px; display: grid; gap: 10px; }
.titulo-receta { font-size: 15px; font-weight: 900; }
.barra-proporciones { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: var(--hueco); }
.barra-proporciones span { flex-basis: 0; min-width: 6px; background: var(--pintura); }
.barra-proporciones .tramo-claro { box-shadow: inset 0 0 0 2px #CFC8BC; }
.receta-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.receta-lista li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 52px; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; }
.gota-receta { width: 16px; height: 16px; margin-left: 3px; }
.receta-gotas { color: var(--tinta); font-variant-numeric: tabular-nums; white-space: nowrap; }
.receta-porcentaje { text-align: right; color: var(--tinta-suave); font-variant-numeric: tabular-nums; white-space: nowrap; }
.explicacion { margin: 0; font-size: 15px; line-height: 1.4; color: var(--tinta-suave); }

/* ---------- Tablet (600 a 1024 px) ---------- */
@media (min-width: 600px) {
  .rejilla { gap: 18px; padding: 18px 18px 0; }
  .paleta { margin: 0 -18px; padding-top: 12px; }
  .botes { gap: 10px; max-width: 720px; margin: 0 auto; }
  .bote { min-height: 96px; }
  .bote-mancha { width: 56px; height: 56px; }
  .bote-nombre { font-size: 15px; }
  .cuenco { max-height: 40vh; max-height: 40dvh; }
  .gota-fila { width: 22px; height: 22px; }
  .muestra-resultado { width: 120px; height: 100px; }
  .acciones .boton { min-height: 60px; font-size: 17px; }
}

/* ---------- Ordenador y tablet en horizontal (más de 1024 px) ---------- */
@media (min-width: 1025px) {
  body.taller { height: 100vh; height: 100dvh; min-height: 640px; }
  .barra { padding: 12px 28px; }
  .rejilla {
    min-height: 0; gap: 22px; padding: 22px 28px 26px;
    grid-template-columns: 236px minmax(0, 1fr) 340px;
    grid-template-areas: "paleta mesa resultado";
  }
  .paleta {
    position: static; margin: 0; border-radius: var(--radio); box-shadow: 0 1px 0 var(--borde);
    padding: 18px 14px; display: flex; flex-direction: column; gap: 10px; overflow: auto;
  }
  .paleta .titulo-zona { position: static; width: auto; height: auto; clip: auto; padding: 0 6px; }
  .botes { grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 0; }
  .bote { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 84px; padding: 0 12px; text-align: left; }
  .bote-mancha { width: 58px; height: 58px; }
  .bote-nombre { flex: 1; font-size: 18px; }
  .bote-cuenta { position: static; min-width: 34px; height: 34px; border-radius: 17px; font-size: 16px; }
  .ayuda { margin-top: auto; text-align: left; padding: 0 6px; }
  .mesa { justify-content: center; padding: 22px; min-height: 0; overflow: auto; }
  .cuenco { max-height: 52vh; max-height: 52dvh; }
  .resultado { overflow: auto; padding: 22px; }
  .resultado .titulo-zona { display: block; }
  .resultado-cabeza { flex-direction: column; align-items: stretch; }
  .muestra-resultado { width: 100%; height: 150px; border-radius: 28px 34px 26px 36px / 32px 26px 36px 28px; }
}

/* ---------- Móvil u otra pantalla en horizontal con poca altura ---------- */
@media (min-width: 640px) and (max-width: 1024px) and (max-height: 560px) and (orientation: landscape) {
  .rejilla {
    gap: 12px; padding: 12px;
    grid-template-columns: 112px minmax(0, 1fr) 270px;
    grid-template-areas: "paleta mesa resultado";
  }
  .paleta { position: static; margin: 0; border-radius: var(--radio); padding: 8px; box-shadow: 0 1px 0 var(--borde); }
  .botes { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .bote { min-height: 60px; flex-direction: row; gap: 6px; }
  .bote-mancha { width: 36px; height: 36px; }
  .bote-nombre { font-size: 13px; }
  .ayuda { display: none; }
  .cuenco { max-height: 46vh; max-height: 46dvh; }
  .muestra-resultado { width: 64px; height: 56px; }
  .nombre-color { font-size: 21px; }
  .receta-lista li { grid-template-columns: 20px minmax(0, 1fr) auto 42px; gap: 6px; font-size: 14px; }
}

@media (max-width: 420px) {
  .acciones .boton { font-size: 15px; padding: 0 10px; gap: 6px; }
  .barra h1 { font-size: 17px; }
  .logo { width: 32px; height: 32px; }
  .modo { font-size: 13px; padding: 6px 10px; }
}
@media (max-width: 400px) {
  .modo { display: none; }
}
