body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:#f6ca33ff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Arial;
}

.app {
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: center;
}

.boardOverlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 10;
}

.boardOverlayPic{
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
  }
  .boardOverlayPic > *{
    width: 100%;
    height: 100%;
  }

/* El tablero SIEMPRE respeta el ancho de pantalla */
.board {
  position: relative;
  aspect-ratio: 1920 / 1080;
  width: min(100vw, 1200px); /* ancho pantalla con tope */
  margin: 0 auto;
  --digits-left: 45.5%; /* dónde arranca el bloque de números */
  --digits-top: -19%;
  --digits-w: 23%; /* ancho total del bloque de números */
  --digits-h: 75%; /* alto total del bloque */
  --digits-gap: 0.2%; /* separación entre dígitos */
}

@media (max-width: 640px){
    .board{
        margin-top: 5em;
        margin-bottom: 5em;
      /* si overlay_celu tiene otra proporción, cambiala acá */
      aspect-ratio: 1080 / 1920; /* EJEMPLO: si el celu es vertical */
      
      /* valores calibrados para overlay_celu.png */
      --digits-left: 20%;
      --digits-top: 13%;
      --digits-w: 27%;
      --digits-h: 9%;
      --digits-gap: 0%;
    }
  }

.counter--board {
  position: absolute;
  left: var(--digits-left);
  top: var(--digits-top);
  width: var(--digits-w);
  height: var(--digits-h);
  display: flex;
  align-items: stretch;
  gap: var(--digits-gap);
  z-index: 1;
}

.counter--board .digit {
  height: 100%;
  width: calc(
    (100% - (var(--digits-gap) * (var(--digits) - 1))) / var(--digits)
  );
  border-radius: clamp(6px, 1vw, 10px);
}

.digit {
  width: 126px;
  height: 189px;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background-color: #f6ca33ff;
}

/* línea central */
.digit::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-1px);
  z-index: 5;
}

/* capas estáticas (lo que se ve quieto) */
.static {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr 1fr;
  z-index: 1;
}

.half {
  overflow: hidden;
  position: relative;
  display: block;
}

/* capas animadas */
.flip {
  position: absolute;
  inset: 0;
  perspective: 800px;
  z-index: 10;
  pointer-events: none;
}

.flip-top,
.flip-bottom {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  overflow: hidden;
  display: block;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  /* filter: drop-shadow(0 12px 10px var(--shadow)); */
}

.flip-top {
  top: 0;
  transform-origin: bottom center;
}

.flip-bottom {
  bottom: 0;
  transform-origin: top center;
  transform: rotateX(90deg);
}

/* wrapper doble altura con el número completo */
.svgWrap {
  position: absolute;
  left: 50%;
  top: 0;
  width: 100%;
  height: 200%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* en la mitad inferior subimos el wrapper para mostrar la parte de abajo */
.half.bottom .svgWrap,
.flip-bottom .svgWrap {
  top: -100%;
}

/* el svg debe ocupar el wrapper (doble alto) */
.svgWrap svg {
  height: 100%;
  width: auto;
  display: block;
}

/* tus SVG de Inkscape: forzamos el relleno del path */
.digit svg path {
  fill: currentColor;
}

/* animación */
.is-flipping .flip-top {
  animation: flipTop 45ms ease-in forwards;
}
.is-flipping .flip-bottom {
  animation: flipBottom 45ms ease-out forwards;
  animation-delay: 45ms;
}

@keyframes flipTop {
  from {
    transform: rotateX(0deg);
  }
  to {
    transform: rotateX(-90deg);
  }
}
@keyframes flipBottom {
  from {
    transform: rotateX(90deg);
  }
  to {
    transform: rotateX(0deg);
  }
}

/* UI demo */
.panel {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

input,
button {
  background: #151515;
  color: #eee;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

button {
  cursor: pointer;
}
