/* しゃてきバンバン — 100dvh フルスクリーンレイアウト */

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: #12080b;
  color: #fff6ec;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  overflow: hidden;
}

#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---- HUD (プレイ中のみ表示) ---- */
#hud {
  flex: 0 0 auto;
  display: flex;
  gap: 1.2em;
  justify-content: center;
  align-items: center;
  padding: 6px 12px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: #1c0d11;
  border-bottom: 1px solid #3a1c22;
  font-variant-numeric: tabular-nums;
}
#hud-level { color: #ffb74d; }
#hud-time  { color: #ffd54f; min-width: 2.2em; text-align: right; }
#hud-time.warn { color: #ff5252; }

/* ---- ステージ ---- */
#stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}
#c {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
#c.aiming { cursor: none; }

/* ---- タイトル / けっか画面 ---- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  background: rgba(14, 6, 9, 0.6);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  user-select: none;
  -webkit-user-select: none;
  overflow-y: auto;
}
.screen h1 {
  font-size: clamp(1.7rem, 8vw, 2.8rem);
  letter-spacing: 0.06em;
  color: #ffe082;
  text-shadow: 0 3px 0 #b71c1c, 0 4px 16px rgba(255, 120, 60, 0.5);
}
.screen .sub {
  font-size: 0.92rem;
  color: #f1d9c8;
  max-width: 26em;
  line-height: 1.7;
}
.hint {
  font-size: 0.8rem;
  color: #c4a9a0;
  max-width: 27em;
  line-height: 1.7;
  display: none;
}
@media (pointer: fine)   { #hint-desktop { display: block; } }
@media (pointer: coarse) { #hint-touch   { display: block; } }
.best { font-size: 0.85rem; color: #ffcc80; min-height: 1em; }

.btn-main {
  padding: 12px 44px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  background: #e53935;
  box-shadow: 0 4px 0 #9a2522;
}
.btn-main:active { transform: translateY(3px); box-shadow: 0 1px 0 #9a2522; }

.sound-btn {
  padding: 5px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #5a3a40;
  border-radius: 999px;
  background: #24131a;
  color: #d8c0b8;
}

.over-score {
  font-size: clamp(2rem, 10vw, 3.2rem);
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.over-new {
  color: #ffd54f;
  font-weight: 800;
  animation: blink 0.8s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0.35; } }
.over-table {
  border-collapse: collapse;
  font-size: 0.92rem;
}
.over-table th, .over-table td { padding: 3px 10px; }
.over-table th { text-align: right; color: #c4a9a0; font-weight: 600; }
.over-table td { text-align: left; font-weight: 800; font-variant-numeric: tabular-nums; }

/* 中身が画面より高いとき、中央寄せだと上端が切れるので上下の余白で寄せる */
.screen { justify-content: flex-start; }
.screen > :first-child { margin-top: auto; }
.screen > :last-child  { margin-bottom: auto; }

/* ---- なまえ入力 ---- */
.name-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #d8c0b8;
}
.name-box input {
  width: 10em;
  padding: 6px 10px;
  font-size: 1rem;           /* 16px未満だとiOSで入力時にズームされる */
  border: 1px solid #5a3a40;
  border-radius: 6px;
  background: #24131a;
  color: #fff6ec;
}
.name-box input:focus { outline: 2px solid #ffb74d; outline-offset: 1px; }

/* ---- ランキング ---- */
#ranking {
  width: min(100%, 22em);
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.85rem;
}
#ranking h3 {
  font-size: 0.85rem;
  color: #ffcc80;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
#ranking table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
#ranking td { padding: 2px 4px; }
#ranking td:first-child { width: 2em; text-align: right; color: #c4a9a0; }
#ranking td.name {
  max-width: 8em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
#ranking td.lv { color: #c4a9a0; }
#ranking td.score { text-align: right; font-weight: 800; }
#ranking tr.me td { color: #ffd54f; }
#ranking p { color: #c4a9a0; margin-top: 2px; }

/* 2026.11.02(02) */
