:root {
  --bg: #0b0f14;
  --panel: #0f1720;
  --accent: #22c1c3;
  --muted: #94a3b8;
}

/* Mobile-First Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: #e6eef6;
  min-height: 100vh;
  padding: 8px;
  touch-action: manipulation;
}

/* Game Container */
.game-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 16px);
}

/* Game Board */
.game-board {
  position: relative;
  flex-grow: 1;
}

canvas {
  width: 100%;
  height: 100%;
  background: #071425;
  border-radius: 6px;
  display: block;
}

/* HUD Panel */
.hud-panel {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 80px;
  background: rgba(15, 23, 32, 0.9);
  border-radius: 6px;
  padding: 6px;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.next-box {
  width: 40px;
  height: 40px;
  background: #071425;
  border-radius: 4px;
  margin: 0 auto;
}

.stat {
  margin-top: 6px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  line-height: 1.3;
  margin-bottom: 3px;
}

.stat-value {
  color: var(--accent);
  font-weight: bold;
}

.title {
  font-size: 10px;
  color: var(--accent);
  margin-bottom: 4px;
  text-align: center;
}

/* ========== [KONTROL TOMBOL INDIVIDUAL] ========== */
.controls {
  padding: 15px 0 10px;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: stretch; /* biar row full width */
}

.button-row {
  display: flex;
  width: 100%;       /* row full width */
  margin-bottom: 15px;
  gap: 12px;
}

/* Tombol Atas (Arah dan Rotasi) */
.btn {
  height: 60px;
  width: 60px;
  background: #0f1724;
  border: none;
  border-radius: 12px;
  font-size: 28px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:active {
  background: #1e293b;
  transform: scale(0.95);
}

/* Tombol Bawah (Aksi) */
.action-btn {
  height: 50px;
  background: #1e293b;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 12px;
  transition: all 0.2s;
  gap: 6px;
}

.action-btn:active {
  background: #2d3b4d;
  transform: scale(0.97);
}

/* ========== [RESPONSIVE MOBILE] ========== */
@media (max-width: 480px) {
  .controls {
    padding: 12px 0 8px;
  }

  .button-row {
    gap: 10px;
    margin-bottom: 12px;
  }

  .btn {
    height: 50px;
    width: 50px;
    font-size: 24px;
  }

  .action-btn {
    height: 44px;
    font-size: 13px;
  }
}

/* Game Overlay */
.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.game-overlay h2 {
  color: white;
  font-size: 20px;
  margin-bottom: 16px;
}

/* ========== [POSISI TOMBOL CUSTOM] ========== */

/* Tombol arah kiri */
#leftBtn {
  margin-right: auto; /* nempel kiri */
}

/* Pause & Reset ke kiri */
#pauseBtn,
#restartBtn {
  margin-right: auto;
}

/* Drop ke kanan */
#hardDropBtn {
  margin-left: auto;
}
