/* yoseq (寄せ球) - 球面タップ式パズルゲーム */

:root {
  --bg: #20212b;
  --panel: #2a2c3a;
  --text: #e8e6f0;
  --text-dim: #9a97ab;
  --accent: #d9b26f;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  touch-action: manipulation;
  overscroll-behavior: none;
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
}

/* ========================================
   タイトル・スコア表示
   ======================================== */

#game-title {
  font-family: Georgia, "Times New Roman", "Hiragino Mincho ProN", serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.4em;
  text-indent: 0.4em; /* letter-spacing 分の中央ずれ補正 */
  color: var(--text-dim);
  margin: 8px 0 0;
}

#score-display {
  display: flex;
  gap: 32px;
  margin: 12px 0 20px;
}

.score-block {
  text-align: center;
}

.score-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
}

#score-value,
#best-value {
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#best-value {
  color: var(--accent);
}

/* ========================================
   盤面（球）
   ======================================== */

#board-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* パネル背景・box-shadow は付けない。球が --bg に浮かんで見えるようにする */
#board {
  display: block;
  width: min(92vw, 420px);
  height: min(92vw, 420px);
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  cursor: grab;
}

#board.dragging {
  cursor: grabbing;
}

#load-notice {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 16px;
}

#load-notice.hidden {
  display: none;
}

/* ========================================
   ゲームオーバー表示（盤面は隠さない）
   ======================================== */

#gameover-panel {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

#gameover-panel.hidden {
  display: none;
}

#gameover-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

#restart-button {
  padding: 10px 28px;
  font-size: 16px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #2a2410;
  font-weight: 600;
  cursor: pointer;
}

#restart-button:active {
  transform: scale(0.97);
}

/* ========================================
   途中リスタート・サウンド切替（誤タップしにくいよう画面右上に小さく）
   ======================================== */

#giveup-button,
#sound-button {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 0.1em;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-dim);
  opacity: 0.6;
  cursor: pointer;
}

#giveup-button {
  right: 16px;
}

#sound-button {
  right: 84px;
}
