:root {
  --bg: #f8fafc;
  --accent: #1e293b;
  --text: #1e293b;
}
* {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: radial-gradient(circle at center, #ffffff 0%, #e2e8f0 100%);
  font-family: -apple-system, system-ui, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: env(safe-area-inset-top);
}

h1 {
  margin: 15px 0 10px;
  font-size: 20px;
  color: #0f172a;
  letter-spacing: 1px;
}

.hud {
  width: 90%;
  max-width: 560px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 10px 15px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 10px;
  z-index: 10;
}

.score-box {
  font-size: 18px;
  font-weight: 800;
  color: #f59e0b;
}

.board-container {
  width: 95%;
  max-width: 560px;
  background: #cbd5e1;
  padding: 6px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

canvas {
  background: #f1f5f9;
  border-radius: 6px;
  display: block;
  width: 100% !important;
  height: auto !important;
}

.dpad {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: grid;
  grid-template-columns: repeat(3, 45px);
  grid-template-rows: repeat(2, 45px);
  gap: 5px;
  z-index: 50;
  justify-items: center;
}

.ctrl-btn {
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #334155;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
  user-select: none;
}

.ctrl-btn:active {
  background: #1e293b;
  color: white;
  transform: scale(0.92);
}

#up {
  grid-column: 2;
  grid-row: 1;
}
#left {
  grid-column: 1;
  grid-row: 2;
}
#down {
  grid-column: 2;
  grid-row: 2;
}
#right {
  grid-column: 3;
  grid-row: 2;
}

.menu-btns .btn {
  background: #1e293b;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.card {
  background: white;
  padding: 40px;
  border-radius: 30px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  width: 80%;
  max-width: 300px;
}
