html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: sans-serif;
  text-align: center;
  background-color: #f4f4f9;
  user-select: none;
  -webkit-user-select: none;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 10px;
}

h1 {
  margin: 0 0 6px 0;
  font-size: 1.4rem;
}

#info {
  display: flex;
  gap: 20px;
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: bold;
}

#startScreen {
  margin-top: 20px;
}

#startScreen p {
  font-size: 1rem;
  margin-bottom: 15px;
}

canvas {
  background: #fff;
  border: 3px solid #333;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  max-width: 85vw;
  max-height: 48vh;
  width: auto;
  height: auto;
  touch-action: none;
}

.main-btn {
  padding: 12px 30px;
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  background-color: #007bff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 0 #0056b3;
}

.main-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

.sub-btn {
  margin-top: 6px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
}

/* 十字キー */
#controls {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(3, 52px);
  gap: 6px;
  justify-content: center;
  margin: 10px auto 0;
}

.dpad-btn {
  font-size: 1.3rem;
  font-weight: bold;
  border-radius: 10px;
  border: 1px solid #aaa;
  background-color: #ffffff;
  box-shadow: 0 3px 0 #bbb;
  touch-action: manipulation;
  cursor: pointer;
}

.dpad-btn:active, .dpad-btn.active {
  transform: translateY(2px);
  box-shadow: none;
  background-color: #ddd;
}

#btn-up { grid-column: 2; grid-row: 1; }
#btn-left { grid-column: 1; grid-row: 2; }
#btn-right { grid-column: 3; grid-row: 2; }
#btn-down { grid-column: 2; grid-row: 3; }