* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #1a1a2e;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: monospace;
  color: #eee;
  padding: 16px;
}

#frame {
  background: #ffcb05;
  border-radius: 18px;
  padding: 18px 18px 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5), inset 0 2px 6px rgba(255,255,255,0.4);
  max-width: 540px;
  width: 100%;
}

#screen-wrap {
  background: #1b3a5c;
  border-radius: 10px;
  padding: 10px;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.6);
}

#game {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  border-radius: 4px;
  background: #000;
}

#dpad-area {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 0 8px;
}

.dpad {
  position: relative;
  width: 120px;
  height: 120px;
}
.dbtn {
  position: absolute;
  width: 40px;
  height: 40px;
  border: none;
  background: #333;
  color: #fff;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}
.dbtn:active { background: #e53935; }
.dbtn.up { top: 0; left: 40px; }
.dbtn.left { top: 40px; left: 0; }
.dbtn.center { top: 40px; left: 40px; background: #222; cursor: default; }
.dbtn.right { top: 40px; left: 80px; }
.dbtn.down { top: 80px; left: 40px; }

.ab { display: flex; gap: 16px; align-items: center; }
.round {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  user-select: none;
}
.round.a { background: #e53935; }
.round.b { background: #455a64; }
.round.snd { background: #2e7d32; width: 40px; height: 40px; font-size: 15px; align-self: flex-start; }
.round:active { filter: brightness(1.3); }

.hint {
  text-align: center;
  margin-top: 12px;
  font-size: 11px;
  color: #6b4f00;
}

@media (max-width: 480px) {
  .dpad { transform: scale(0.85); }
  .round { width: 48px; height: 48px; }
}
