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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  touch-action: none;
  font-family: "Hiragino Sans", "Meiryo", sans-serif;
}

/* ------------------------------ */
/* 設定画面 */
/* ------------------------------ */

#setup-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0b0b2b, #1a1a4a);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

#setup-screen h1 {
  font-size: 2.2em;
  margin-bottom: 8px;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}

.subtitle {
  font-size: 1.1em;
  margin-bottom: 30px;
  opacity: 0.85;
}

.mode-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 480px;
}

.mode-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 14px;
  color: #fff;
  padding: 16px 20px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.5);
}

.mode-btn.selected {
  background: rgba(255, 200, 80, 0.25);
  border-color: #ffcf5c;
  box-shadow: 0 0 15px rgba(255, 207, 92, 0.5);
}

.mode-title {
  display: block;
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 6px;
}

.mode-desc {
  display: block;
  font-size: 0.9em;
  opacity: 0.8;
  line-height: 1.4;
}

#start-btn {
  margin-top: 36px;
  padding: 14px 50px;
  font-size: 1.3em;
  font-weight: bold;
  color: #1a1a4a;
  background: #ffcf5c;
  border: none;
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(255, 207, 92, 0.4);
}

#start-btn:disabled {
  background: #555;
  color: #999;
  cursor: not-allowed;
  box-shadow: none;
}

#start-btn:not(:disabled):hover {
  transform: scale(1.05);
}

/* ------------------------------ */
/* ゲーム画面 */
/* ------------------------------ */
#canvas {
  display: none;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

#back-btn {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.3em;
  cursor: pointer;
  z-index: 50;
}

#back-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}


/* ------------------------------------------------------------ */
/* 視線モード（追加分）※既存スタイルは変更していません */
/* ------------------------------------------------------------ */

#gaze-slider-wrapper {
  position: fixed;
  top: 16px;
  right: 72px; /* #back-btn(44px幅+16px余白)の左側に配置 */
  display: none; /* 初期は非表示。視線モード選択時のみJSで表示 */
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 40px;
  padding: 8px 18px;
  color: #fff;
  font-size: 0.9em;
  z-index: 50;
  backdrop-filter: blur(4px);
}

#gaze-slider-wrapper label {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

#gaze-duration-value {
  color: #FFC300;
  font-weight: bold;
  min-width: 2.2em;
  display: inline-block;
  text-align: right;
}

#gaze-duration-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  cursor: pointer;
}

#gaze-duration-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFC300;
  box-shadow: 0 0 8px rgba(255, 195, 0, 0.7);
  cursor: pointer;
}

#gaze-duration-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFC300;
  border: none;
  box-shadow: 0 0 8px rgba(255, 195, 0, 0.7);
  cursor: pointer;
}

/* 画面が狭い場合はスライダー幅を縮小 */
@media (max-width: 600px) {
  #gaze-slider-wrapper {
    right: 64px;
    padding: 6px 12px;
    font-size: 0.8em;
  }
  #gaze-duration-slider {
    width: 80px;
  }
}


/* ========== ロゴ ========== */
#shimada-logo {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 100;
  width: 180px;
  opacity: 0.7;
  pointer-events: none;
}