@font-face {
  font-family: 'PressStart';
  src: url('../assets/fonts/PressStart2P-Regular.ttf') format('truetype');
  font-display: block;
}

:root {
  --bg: #0b1020;
  --text: #e8f1ff;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

/* The safe-area padding keeps the canvas clear of the notch and the home bar. */
#game {
  position: fixed;
  inset: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
}

#game canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Name fields are Phaser DOM elements; they are styled here, sized in game pixels. */
.name-input {
  width: 112px;
  height: 14px;
  padding: 1px 3px;
  box-sizing: border-box;
  font: 8px/12px 'PressStart', monospace;
  color: #0b1020;
  background: #e8f1ff;
  border: 1px solid #0b1020;
  border-radius: 0;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
}
.name-input:focus {
  background: #fff;
  border-color: #f0c030;
}

#rotate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  font: 14px/1.6 'PressStart', monospace;
  text-align: center;
}

.rotate-phone {
  width: 40px;
  height: 70px;
  border: 4px solid var(--text);
  border-radius: 8px;
  animation: rotate-hint 2s ease-in-out infinite;
}

@keyframes rotate-hint {
  0%, 20% { transform: rotate(0deg); }
  50%, 80% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

/* Only touch devices are asked to rotate; a tall desktop window just letterboxes. */
@media (orientation: portrait) and (pointer: coarse) {
  #rotate { display: flex; }
}
