/* 冷やしたぬきそば — レトロ・ドット絵ゲーム
   論理解像度 180×320 を nearest-neighbor で拡大表示する */

/* レトロなドットフォント。assets/fonts/ にファイルを置くと反映（未配置でも丸ゴシックにフォールバック）。
   woff2 優先・ttf は file:// 直開きのフォールバック。Codex がフォントファイルを配置する想定。 */
@font-face {
  font-family: "PixelFont";
  src: url("assets/fonts/pixel.woff2") format("woff2"),
       url("assets/fonts/pixel.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

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

html, body {
  width: 100%;
  height: 100%;
  background: #0d0a14;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  overscroll-behavior: none;
}

#stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 切り欠き(ノッチ)対応 */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#view {
  /* ドット絵をくっきり拡大（nearest-neighbor） */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  display: block;
  background: #000;
  /* レトロな縁取り */
  box-shadow: 0 0 0 2px #000, 0 0 20px rgba(0, 0, 0, 0.6);
}

/* ============ ランキング登録：名前入力モーダル（canvasの上に重ねる） ============ */
#nameModal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.62);
  -webkit-tap-highlight-color: transparent;
}

#nameModal[hidden] { display: none; }

.name-box {
  width: min(300px, 90%);
  padding: 18px 16px 16px;
  border: 2px solid #caa24a;
  border-radius: 12px;
  background: linear-gradient(#2b1b0e, #1b1009);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  text-align: center;
  font-family: "PixelFont", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  color: #fff8df;
}

.name-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 900;
  color: #ffd23f;
  text-shadow: 2px 2px 0 #201208;
}

#nameInput {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 2px solid #e0a336;
  border-radius: 8px;
  background: rgba(255, 248, 223, 0.96);
  color: #201208;
  font-family: inherit;
  font-size: 20px;
  font-weight: 900;
  text-align: center;
  outline: none;
}

#nameInput::placeholder { color: #9c8a66; }

.name-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.name-actions button {
  flex: 1;
  min-height: 46px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

#nameOk {
  border: 2px solid #fff8df;
  background: linear-gradient(#ffe28e, #e3aa40);
  color: #2a1804;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
  text-shadow: 1px 1px 0 rgba(255, 248, 223, 0.6);
}

#nameCancel {
  border: 2px solid #e0a336;
  background: rgba(28, 18, 10, 0.82);
  color: #ffe9a8;
  text-shadow: 1px 1px 0 #201208;
}

