/* ASMR BLOCKS - style.css (PHASE 1)
   落ち着いた暗めの青系デザイン。スマホ縦持ちを基準にする。 */

:root {
  --bg: #0b1220;
  --text: #e8f1fb;
  --muted: #8fa6c1;
  --accent: #7fd4ff;
  --accent-2: #b7a6ff;
  --panel: rgba(11, 18, 32, 0.78);
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", "Meiryo", system-ui, sans-serif;
}

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

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overscroll-behavior: none;
  /* 長押し選択・スクロール・ズームを防ぐ */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

body {
  position: fixed;
  inset: 0;
  width: 100%;
}

.hidden {
  display: none !important;
}

/* ---------- 全体レイアウト ---------- */

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  background:
    radial-gradient(120% 80% at 50% 0%, #15243d 0%, var(--bg) 70%);
}

/* ---------- 情報バー ---------- */

#hud {
  /* 幅はゲーム領域と同じになるよう main.js が設定する */
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.15fr) minmax(0, 0.9fr) 44px 44px;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
}

#app.on-title #hud {
  visibility: hidden;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.hud-score {
  align-items: center;
}

.hud-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.hud-value {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

/* ステージ名は英字で少し小さく */
#hud-stage {
  font-size: 14px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.next-stage {
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.hud-lives {
  font-size: 14px;
  letter-spacing: 0.15em;
  color: var(--accent);
  line-height: 1.5;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
}

.icon-btn:active {
  background: rgba(255, 255, 255, 0.16);
}

/* ミュートの見た目：音が出ているときは波、ミュート中は×印 */
#btn-mute .slash { display: none; }
#btn-mute.muted .wave { display: none; }
#btn-mute.muted .slash { display: inline; }
#btn-mute.muted { color: var(--muted); }

/* 音量スライダー */
.volume {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 220px;
  margin-top: 4px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.vol-slider {
  flex: 1;
  min-width: 0;
  height: 44px;               /* 指で触りやすい高さ */
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: pan-x;
}

.vol-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
}

.vol-slider::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -11px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.vol-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.best {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.best span {
  margin-left: 6px;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.record {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.18em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* スマホを横向きにしたら、全体を隠して案内を出す */
#rotate-notice {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  letter-spacing: 0.1em;
  text-align: center;
}

@media (orientation: landscape) and (max-height: 500px) {
  #rotate-notice {
    display: flex;
  }
}

.hint {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------- ゲーム領域 ---------- */

#field {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#stage-wrap {
  /* 幅・高さは main.js が画面に合わせて設定する */
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ---------- 画面（タイトル・クリア等） ---------- */

#overlay {
  position: absolute;
  inset: 0;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  text-align: center;
  background: var(--panel);
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 44px;
  font-weight: 300;
  letter-spacing: 0.22em;
  line-height: 1.15;
  padding-left: 0.22em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo span {
  font-weight: 600;
}

.catch {
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 12px;
}

.screen-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.result dt {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.result dd {
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.btn {
  min-width: 180px;
  min-height: 52px;
  padding: 0 32px;
  border: none;
  border-radius: 26px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.12em;
  cursor: pointer;
  touch-action: manipulation;
}

.btn.primary {
  color: #08111f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 20px rgba(127, 212, 255, 0.25);
}

.btn.primary:active {
  transform: scale(0.97);
}

@media (hover: hover) {
  .btn.primary:hover {
    filter: brightness(1.08);
  }
}

/* 小さい画面では文字を少し小さく */
@media (max-width: 360px) {
  .logo {
    font-size: 36px;
  }
}

/* JavaScriptが無効なときのメッセージ */
.noscript-msg {
  padding: 24px;
  color: var(--text);
}
