/* リズムタップ 共通スタイル
   テーマ色(--bg / --primary / --accent)はステージ選択時に game.js が上書きする */

:root {
  --bg: #1a1a2e;
  --primary: #4fc3f7;
  --accent: #ffd54f;
  --text: #eceff1;
  --danger: #ef5350;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overflow: hidden;
  transition: background 0.4s;
}

#app {
  height: 100vh;
  height: 100dvh;
}

.screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2em;
  padding: 1em;
  text-align: center;
}

.screen[hidden] {
  display: none;
}

/* ---- タイトル画面 ---- */

.game-title {
  font-size: clamp(2em, 9vw, 3.2em);
  margin: 0;
  color: var(--primary);
  text-shadow: 0 0 18px color-mix(in srgb, var(--primary) 60%, transparent);
  letter-spacing: 0.08em;
}

.tagline {
  margin: 0;
  line-height: 1.8;
  opacity: 0.9;
}

.name-box {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}

.name-box label {
  font-size: 0.85em;
  opacity: 0.8;
}

#player-name {
  font-size: 1.2em;
  padding: 0.5em 0.8em;
  border: 2px solid var(--primary);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  text-align: center;
  width: 12em;
  max-width: 80vw;
  outline: none;
}

.note {
  font-size: 0.8em;
  color: var(--danger);
  margin: 0;
}

/* ---- ボタン ---- */

.btn {
  font-size: 1.1em;
  padding: 0.7em 2.2em;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  color: #111;
  touch-action: manipulation;
}

.btn-main {
  background: var(--primary);
  box-shadow: 0 0 14px color-mix(in srgb, var(--primary) 50%, transparent);
}

.btn-sub {
  background: rgba(255, 255, 255, 0.25);
  color: var(--text);
}

.btn:active {
  transform: scale(0.95);
}

.btn-row {
  display: flex;
  gap: 1em;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---- ステージセレクト ---- */

#stage-list {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  width: min(420px, 92vw);
}

.stage-card {
  display: block;
  width: 100%;
  border: 2px solid var(--card-color, var(--primary));
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0.8em 1em;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.stage-card:active {
  transform: scale(0.98);
}

.stage-card .stage-name {
  font-size: 1.15em;
  font-weight: bold;
  color: var(--card-color, var(--primary));
}

.stage-card .stage-info {
  font-size: 0.85em;
  opacity: 0.85;
  margin-top: 0.3em;
}

.stage-card .stage-best {
  font-size: 0.8em;
  color: var(--accent);
  margin-top: 0.2em;
}

/* ---- プレイ画面 ---- */

.screen-play {
  position: relative;
  padding: 0;
  gap: 0;
}

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6em;
  padding: 0.6em 0.8em;
  font-size: 1.05em;
  font-weight: bold;
  z-index: 2;
  font-variant-numeric: tabular-nums;
}

#hud-lives {
  color: var(--danger);
  letter-spacing: 0.1em;
}

#btn-mute {
  font-size: 1.1em;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 8px;
  padding: 0.25em 0.5em;
  cursor: pointer;
}

#pulse-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#judgement {
  position: absolute;
  top: 22%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 2em;
  font-weight: bold;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}

#judgement.show {
  animation: judge-pop 0.5s ease-out;
}

#judgement.perfect { color: var(--accent); }
#judgement.good    { color: var(--primary); }
#judgement.miss    { color: var(--danger); }
#judgement.info    { color: var(--text); }

@keyframes judge-pop {
  0%   { opacity: 1; transform: scale(1.4); }
  30%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

#play-hint {
  position: absolute;
  bottom: 1em;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.85em;
  opacity: 0.6;
  pointer-events: none;
  z-index: 2;
}

/* ---- ゲームオーバー / ランキング ---- */

#result-summary {
  font-size: 1.15em;
  line-height: 1.8;
  margin: 0;
}

#result-summary .big {
  font-size: 1.6em;
  color: var(--accent);
  font-weight: bold;
}

#ranking {
  width: min(420px, 92vw);
  max-height: 40vh;
  overflow-y: auto;
}

#ranking h3 {
  margin: 0 0 0.4em;
  font-size: 1em;
}

#ranking table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
}

#ranking th, #ranking td {
  padding: 0.3em 0.4em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
}

#ranking th {
  opacity: 0.7;
  font-weight: normal;
  font-size: 0.85em;
}

#ranking tr.me td {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent);
  font-weight: bold;
}

#ranking .out-of-rank {
  margin: 0.5em 0 0;
  font-size: 0.9em;
  color: var(--accent);
}

/* 2026.07.12(01) */
