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

body {
  background: #1a1a2e;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: monospace;
  overflow: hidden;
  touch-action: manipulation;
}

#device {
  background: linear-gradient(145deg, #3d3d5c, #2a2a44);
  border-radius: 24px;
  padding: 20px 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  max-width: 360px;
  width: 90vw;
}

#device-top {
  width: 100%;
  text-align: center;
}

#device-label {
  color: #8888aa;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

#menu-icons {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 4px 0;
}

#menu-icons img {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  opacity: 0.5;
  transition: opacity 0.15s, transform 0.15s;
  cursor: pointer;
}

#menu-icons img.selected {
  opacity: 1;
  transform: scale(1.2);
  filter: drop-shadow(0 0 3px rgba(155, 188, 15, 0.8));
}

#lcd-frame {
  background: #0f380f;
  border-radius: 8px;
  padding: 8px;
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
}

#lcd {
  display: block;
  width: min(75vw, 300px);
  height: min(75vw, 300px);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #9bbc0f;
  border-radius: 4px;
}

#buttons {
  display: flex;
  gap: 28px;
  padding: 12px 0;
}

#buttons button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(145deg, #555577, #444466);
  color: #aaaacc;
  font-family: monospace;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
  -webkit-tap-highlight-color: transparent;
}

#buttons button:active {
  transform: scale(0.9) translateY(2px);
  background: linear-gradient(145deg, #3a3a55, #333350);
  border-color: rgba(155, 188, 15, 0.4);
  color: #9bbc0f;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

#controls-help {
  display: flex;
  gap: 12px;
  color: #666688;
  font-size: 9px;
  letter-spacing: 0.5px;
}

/* Mobile adjustments */
@media (max-width: 400px) {
  #device {
    padding: 16px 12px 20px;
    border-radius: 20px;
  }

  #menu-icons img {
    width: 24px;
    height: 24px;
  }

  #buttons button {
    width: 50px;
    height: 50px;
    font-size: 12px;
  }

  #controls-help {
    font-size: 8px;
  }
}
