/* =========================
   MENÚ INFERIOR – SMARTPHONE
   ========================= */
.bottom-menu {
    position: relative; 
    width: 90%;
    max-width: 420px;
    margin: 2px auto 15px auto; /* Solo 2px de separación con el área de retos */
    padding: 10px;
    background: #1e1e1e;
    border-radius: 16px;
    z-index: 70;
  }
.bottom-menu .buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 6px;
  width: 100%;
}

/* 3ª fila = reto final (L), ancho completo — igual que ES/EN/UK… */
.bottom-menu .buttons > button:nth-child(12),
.bottom-menu .buttons > button.block-btn-final {
  grid-column: 1 / -1;
  height: auto;
  min-height: 48px;
  white-space: normal;
  line-height: 1.15;
  padding: 6px 8px;
}

.bottom-menu button {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 40px;
  font-size: clamp(9px, 2.35vw, 12px);
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  background: #2e2e2e;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  line-height: 1.1;
  white-space: nowrap;
  padding: 0 2px;
  overflow: hidden;
  text-overflow: clip;
  letter-spacing: -0.02em;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.bottom-menu button:not(.block-btn-final) {
  font-size: clamp(9px, 2.35vw, 12px) !important;
}

.bottom-menu button .block-lock {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 8px;
  line-height: 1;
  pointer-events: none;
}

.bottom-menu button .block-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
}

.bottom-menu button.block-btn-final {
  font-size: clamp(13px, 3.4vw, 17px);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.bottom-menu button:active {
  opacity: 0.7;
  transform: scale(0.98); /* Android: respuesta visual clara al tocar */
}

.bottom-menu button.active {
  background: #5b93ff;
  color: #ffffff;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.45), 0 1px 2px rgba(0, 0, 0, 0.25);
}

.bottom-menu button.active.block-btn-final {
  font-weight: 700;
}

.bottom-menu button.completed {
  background: #2ecc71;
  color: #0b3d1f;
}

.bottom-menu button:disabled {
  background: #555;
  color: #aaa;
  cursor: not-allowed;
}

/* Sensor: Pantalla muy pequeña (iPhone SE Gen 1, ancho < 330px) */
@media (max-width: 400px) {
  .bottom-menu button:not(.block-btn-final) {
    font-size: clamp(8px, 2.2vw, 11px) !important;
    height: 38px;
    padding: 0 1px;
  }
}

@media (max-width: 330px) {
  .bottom-menu .buttons {
    gap: 4px;
  }
  .bottom-menu button {
    font-size: clamp(8px, 2.2vw, 10px) !important;
    height: 32px !important;
    padding: 0 1px;
  }
  .bottom-menu .buttons > button:nth-child(12),
  .bottom-menu .buttons > button.block-btn-final {
    height: auto !important;
    min-height: 44px !important;
  }
  .bottom-menu button.block-btn-final {
    font-size: clamp(12px, 3vw, 15px) !important;
  }
}

/* Barra de bloques fuera del panel: mismo aire inferior que ES/EN (no pegada al borde) */
.app-block-bar-wrap {
  box-sizing: border-box;
  padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
}

.app-block-bar-wrap .bottom-menu {
  width: 100%;
  max-width: none;
  margin: 2px auto 15px auto;
}