html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0a0d18;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
}
body {
  position: fixed;
  inset: 0;
}
#wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #141b33 0%, #0a0d18 75%);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
canvas {
  display: block;
  touch-action: none;
}

/* ---- ログイン / 新規作成オーバーレイ（ゲームと同じ世界観） ---- */
#auth {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 20, 0.35);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}
.hidden { display: none !important; }

.auth-card {
  width: min(360px, 88vw);
  max-height: 92vh;
  overflow-y: auto;
  background: rgba(12, 17, 38, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 24px 26px 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}
.auth-logo {
  font-size: 36px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 2px;
  background: linear-gradient(#ffe36a, #ffb036 55%, #ff7a4a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(42, 58, 106, 0.9));
}
.auth-sub {
  color: #cfd8ff;
  font-size: 13px;
  text-align: center;
  margin: 6px 0 14px;
}
.auth-error {
  color: #ff8a8a;
  font-size: 12px;
  min-height: 16px;
  text-align: center;
  margin-bottom: 2px;
}
#auth input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 8px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 15px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}
#auth input::placeholder { color: #8a94b8; }
#auth input:focus { border-color: #f5b731; background: rgba(255, 255, 255, 0.12); }
#auth button {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 24px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}
#auth button.primary {
  background: #f5b731;
  border-color: #8a6a10;
  color: #3a2c08;
}
#auth button.ghost {
  font-size: 12px;
  padding: 9px;
  border-style: dashed;
  color: #cfd8ff;
}
#auth button:hover { filter: brightness(1.08); }
#auth button:active { transform: scale(0.98); }
.auth-note {
  color: #8a94b8;
  font-size: 11px;
  text-align: center;
  margin-top: 14px;
}
