/* Piezas de la interfaz: encabezado, tarjeta de figura, objetivo ampliado, controles y pie de desarrollo */

/* Encabezado: título y selector Create / Shapes */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.modes { display: inline-flex; gap: 2px; padding: 4px; background: var(--well); border-radius: 999px; }
.modes button {
  min-height: 40px;
  padding: 0 15px;
  font-size: 14px;
  color: var(--dim);
  background: transparent;
  border-radius: 999px;
  box-shadow: none;
}
.modes button[aria-pressed="true"] {
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(74, 58, 40, 0.1), 0 3px 8px rgba(74, 58, 40, 0.06);
}

/* Figura objetivo: miniatura sobre el tablero, se agranda al tocarla */
.goal {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding: 10px 18px 10px 10px;
  background: var(--card);
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(74, 58, 40, 0.06), 0 8px 24px rgba(74, 58, 40, 0.07);
}
.goal-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  min-height: 72px;
  padding: 0;
  overflow: hidden;
  background: var(--frame);
  border-radius: 14px;
  box-shadow: none;
}
#thumb { display: block; width: 72px; height: 72px; }
.goal-thumb svg {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 18px;
  height: 18px;
  padding: 3px;
  background: var(--scrim);
  border-radius: 50%;
}
.goal-thumb path, .target-full path { fill: none; stroke: var(--card); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Objetivo ampliado: ocupa el lugar del tablero */
.target-full {
  position: relative;
  min-height: 0;
  padding: 0;
  background: transparent;
  border-radius: var(--board-radius);
  box-shadow: 0 16px 48px rgba(74, 58, 40, 0.3);
}
#target-big { display: block; border-radius: var(--board-radius); }
.target-tag {
  position: absolute;
  left: 50%;
  bottom: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  transform: translateX(-50%);
  font: 500 12px/1 var(--font-ui);
  color: var(--card);
  white-space: nowrap;
  background: var(--scrim);
  border-radius: 999px;
}
.target-tag svg { width: 14px; height: 14px; }

/* Indicación bajo el tablero */
.hint {
  margin: 0;
  min-height: 2.6em;
  padding: 0 14px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  line-height: 1.3;
  color: var(--dim);
  text-align: center;
  text-wrap: balance;
}

/* Controles: tamaño de pieza (Create) y color y encendido del foco seleccionado */
.size, .lamp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 14px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--lift);
}
.size label { font-size: 13px; font-weight: 500; color: var(--dim); }
.size output { font-size: 13px; font-weight: 500; color: var(--text); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
#size { flex: 1; min-width: 0; height: 40px; accent-color: var(--text); }
#size:disabled + output { color: var(--dim); }

/* Los colores del foco van sueltos sobre la arena, sin tarjeta */
.lamp-row { justify-content: space-between; padding: 0; background: transparent; box-shadow: none; }
.swatches { display: flex; gap: 10px; }
.swatch {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 1px 2px rgba(74, 58, 40, 0.18);
}
.swatch[aria-checked="true"] { box-shadow: 0 0 0 3px var(--sand), 0 0 0 4.5px var(--text); }
#lamp-power { min-width: 76px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; }
/* Punto de luz: lleno si el foco está encendido, hueco si está apagado */
#lamp-power::before { content: ""; width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--dim); }
#lamp-power[aria-pressed="true"]::before { background: var(--lamp); box-shadow: none; }

/* Shapes: flechas entre figuras y, en la tarjeta, número, nombre, avance y medidor */
.level { display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px; min-height: 52px; }
.level-info { display: grid; align-content: center; gap: 7px; min-width: 0; }
.level-top, .meter-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.level-num { font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.level-name { font-family: var(--font-display); font-style: italic; font-size: 29px; line-height: 0.95; }
.dots { display: flex; align-items: center; gap: 5px; }
.dot { width: 6px; height: 6px; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--dim); }
.dot.done { background: var(--text); box-shadow: none; }
.dot.here { width: 16px; background: var(--lamp); box-shadow: none; }
.meter { position: relative; flex: 1; height: 4px; background: var(--track); border-radius: 2px; }
.meter-fill { height: 100%; width: 0; background: var(--text); border-radius: 2px; }
.match { min-width: 52px; font-size: 13px; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.solved .meter-fill { background: var(--ok); }
.solved .match { color: var(--ok); }

/* Botones */
.buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.buttons.two { grid-template-columns: repeat(2, 1fr); }
button {
  min-height: 44px;
  padding: 0 8px;
  font: 500 15px/1.1 var(--font-ui);
  color: var(--text);
  background: var(--card);
  border: 0;
  border-radius: 18px;
  box-shadow: var(--lift);
  touch-action: manipulation;
  cursor: pointer;
}
button.icon { display: grid; place-items: center; padding: 0; }
button.icon path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.38; cursor: default; }
button.go { background: var(--lamp); color: var(--text); }
button:focus-visible, #size:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Pie de desarrollo: versión instalada y botón para traer la última */
.dev { display: flex; align-items: center; gap: 10px; min-height: 30px; font: 500 11px/1.2 var(--font-ui); color: var(--dim); }
.dev-status { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev button { min-height: 30px; padding: 0 10px; font: 500 11px/1 var(--font-ui); border-radius: 10px; }

/* Pantallas angostas: el encabezado cabe en una línea */
@media (max-width: 420px) {
  h1 { font-size: 26px; }
  .bar { gap: 8px; }
  .modes button { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) { button:active { transform: none; } }
