#tetris-container,
#tetris-container * {
  box-sizing: border-box;
}

/* ============================= */
/* CONTAINER */
/* ============================= */
#tetris-container {
  margin: 0 auto;
  text-align: center;
  padding: 20px;
  border-radius: 20px;
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

/* ============================= */
/* CANVAS */
/* ============================= */
#tetris {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;

  border-radius: 16px;
  border: 2px solid #02C786;
  background: rgba(19, 19, 19, 1);

  box-shadow:
    0 0 30px rgba(2, 199, 134, 0.25),
    inset 0 0 40px rgba(2, 199, 134, 0.05);
}

/* ============================= */
/* SCORE */
/* ============================= */
#score {
  margin-top: 16px;
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
}

#score-value {
  color: #02C786;
  font-weight: 800;
}

/* ============================= */
/* GAME OVER */
/* ============================= */
#game-over-overlay {
  position: absolute;
  inset: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(19, 19, 19, 0.88);
  backdrop-filter: blur(6px);
  border-radius: 16px;
  z-index: 10;
}

.game-over-box {
  text-align: center;
  padding: 22px;
  border-radius: 16px;
  background: rgba(15, 15, 15, 0.95);
  border: 2px solid #02C786;
  box-shadow: 0 0 35px rgba(2, 199, 134, 0.25);
  width: 90%;
  max-width: 260px;
}

.game-over-box h3 {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 20px;
}

.game-over-box p {
  margin: 0 0 18px;
  color: #ffffff;
  font-size: 16px;
}

#final-score {
  color: #02C786;
  font-weight: 800;
}

#restart-btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid #02C786;
  background: rgba(2, 199, 134, 0.18);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  transition: 0.15s ease;
}

#restart-btn:hover {
  background: #02C786;
  color: #131313;
}

/* ============================= */
/* D-PAD */
/* ============================= */
#tetris-controls {
  display: none;
}

@media (max-width: 1024px) {

  #tetris-controls {
    display: flex;
    justify-content: center;
    margin-top: 14px; /* iets minder ruimte */
    width: 100%;
  }

  .dpad {
    width: clamp(150px, 50vw, 220px); /* 👈 kleiner dan voorheen */
    aspect-ratio: 1 / 1;
    position: relative;
  }

  .dpad-btn {
    position: absolute;
    width: 33.333%;
    height: 33.333%;

    border: 2px solid rgba(2, 199, 134, 0.6);
    background-color: rgba(14, 47, 45, 0.95);

    box-shadow:
      0 0 12px rgba(2, 199, 134, 0.18),
      inset 0 0 8px rgba(2, 199, 134, 0.06);

    cursor: pointer;
    touch-action: manipulation;

    background-repeat: no-repeat;
    background-position: center;
    background-size: 26px 26px; /* 👈 kleinere iconen */

    transition: transform 0.08s ease,
                background-color 0.08s ease,
                border-color 0.08s ease;
  }

  .dpad-left {
    left: 0;
    top: 33.333%;
    border-radius: 14px 8px 8px 14px;
    background-image: url("/sf/wp-content/themes/searchflow/assets/image/left.svg");
  }

  .dpad-up {
    left: 33.333%;
    top: 0;
    border-radius: 14px 14px 8px 8px;
    background-image: url("/sf/wp-content/themes/searchflow/assets/image/turn.svg");
  }

  .dpad-right {
    right: 0;
    top: 33.333%;
    border-radius: 8px 14px 14px 8px;
    background-image: url("/sf/wp-content/themes/searchflow/assets/image/right.svg");
  }

  .dpad-down {
    left: 33.333%;
    bottom: 0;
    border-radius: 8px 8px 14px 14px;
    background-image: url("/sf/wp-content/themes/searchflow/assets/image/down.svg");
  }

  .dpad-center {
    position: absolute;
    left: 33.333%;
    top: 33.333%;
    width: 33.333%;
    height: 33.333%;
    border-radius: 999px;
    background: rgba(19, 19, 19, 0.95);
    border: 2px solid rgba(2, 199, 134, 0.35);
    box-shadow: inset 0 0 8px rgba(0,0,0,0.6);
    pointer-events: none;
  }

  .dpad-btn:active,
  .dpad-btn.is-pressed {
    transform: scale(0.94);
    background-color: rgba(2, 199, 134, 0.22);
    border-color: rgba(2, 199, 134, 1);
  }
}
