@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap');

:root { color-scheme: dark; }

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

body {
  font-family: 'Inter', -apple-system, 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  background: radial-gradient(circle at 50% 15%, #141428 0%, #0a0a14 60%, #060610 100%);
  color: #f0f0f8;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  min-height: 100svh;
}

.game-root {
  height: 100svh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

.canvas-stage {
  width: min(100vw, calc(100svh * 480 / 720));
  max-height: 100svh;
  aspect-ratio: 480 / 720;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(50,50,80,0.6);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 16px 48px rgba(0,0,0,0.65),
    0 0 40px rgba(100,140,255,0.06);
  position: relative;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 480 / 720;
  max-width: 100%;
  max-height: 100%;
  background: #0c0c1a;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  touch-action: none;
}

.canvas-stage .game-name-input {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

.canvas-stage.name-input-active .game-name-input {
  left: calc(100% * 54 / 480);
  top: calc(100% * 324 / 720);
  width: calc(100% * 246 / 480);
  height: calc(100% * 44 / 720);
  opacity: 1;
  pointer-events: auto;
  z-index: 30;
  margin: 0;
  padding: 0 12px;
  box-sizing: border-box;
  font: bold 20px 'Inter', "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: #fff;
  background: rgba(22, 22, 32, 0.96);
  border: 2px solid #ffd54a;
  border-radius: 8px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  user-select: text;
  -webkit-user-select: text;
  touch-action: manipulation;
}
