* { box-sizing: border-box; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

html, body {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;      /* iOS Safari: no text selection on long-press */
  -webkit-touch-callout: none;    /* iOS Safari: no Copy/Look Up callout on long-press */
  background: #2a2a35;
  margin: 0;
  min-height: 100vh;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #eee;
}

.gb {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 480px;
  padding: 16px 12px 24px;
  gap: 18px;
}

.screen-frame {
  width: 100%;
  height: min(60vh, calc(100vw * 0.9 * 0.9));
  background: #5c4b8a;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25), inset 0 4px 0 rgba(255, 255, 255, 0.08), 0 6px 12px rgba(0, 0, 0, 0.4);
}

#screen {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #9bbc0f;
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px #1f1a33;
}

.controls {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dpad {
  position: relative;
  width: 148px;
  height: 148px;
  display: grid;
  grid-template-columns: 56px 56px 56px;
  grid-template-rows: 56px 56px 56px;
  place-items: center;
}

.dpad-btn {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  background: #3a3a4a;
  border: none;
  border-radius: 10px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
}

.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 3; }
.dpad-center {
  grid-column: 2; grid-row: 2;
  width: 56px; height: 56px;
  background: #3a3a4a;
}

.ab {
  display: flex;
  align-items: center;
  gap: 14px;
  transform: rotate(-15deg);
}

.ab-btn {
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  border-radius: 50%;
  border: none;
  background: #b0305c;
  color: #fff;
  font-weight: bold;
  font-size: 18px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
}

.bottom-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.start {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  padding: 0;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-15deg);
}

.start-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  height: 30px;
  padding: 0 18px;
  border-radius: 14px;
  background: #3a3a4a;
  color: #eee;
  pointer-events: none;
}

#mute {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  border-radius: 50%;
  border: none;
  background: #3a3a4a;
  color: #eee;
  font-size: 18px;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.held {
  filter: brightness(0.65);
}
