/* お題時限爆弾 - スタイル */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* ダブルタップ拡大を無効化 */
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: #0d0202;
  color: #f5e9e9;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* ===== 画面切替 ===== */
.screen {
  display: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.screen.active {
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100%;
}

/* ===== メイン画像（スタート画面のロゴ） ===== */
.main-image {
  display: block;
  margin: 4px auto 0;
  width: 64%;
  max-width: 260px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(255, 80, 80, 0.35));
}

/* ===== キャッチコピー ===== */
.catchcopy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 10px 12px 8px;
  padding: 14px 8px 18px;
  position: relative;
}

.catchcopy::before,
.catchcopy::after {
  content: "";
  display: block;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 200, 0, 0.7), transparent);
}
.catchcopy::before { top: 0; }
.catchcopy::after  { bottom: 0; }

.catchcopy-line,
.catchcopy-accent {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #ffd700 0%, #ff8c00 60%, #ff5252 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(255, 180, 0, 0.35);
  line-height: 1.25;
  white-space: nowrap;
}

@media (max-width: 360px) {
  .catchcopy-line,
  .catchcopy-accent {
    font-size: 20px;
    letter-spacing: 0.02em;
  }
}

/* ===== 音声案内 ===== */
.audio-notice {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #c4a888;
  background: rgba(255, 200, 100, 0.08);
  border: 1px solid rgba(255, 200, 100, 0.25);
  border-radius: 10px;
  padding: 8px 12px;
  margin: -2px 12px 4px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}
.title {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  margin-top: 8px;
}
.label {
  font-size: 13px;
  font-weight: 700;
  color: #c4a8a8;
  display: block;
  margin-bottom: 10px;
  margin-top: 4px;
}
.hint {
  font-size: 12px;
  color: #9c8585;
  text-align: center;
  line-height: 1.6;
}

/* ===== カード ===== */
.card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 100, 100, 0.15);
  border-radius: 16px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===== ボタン ===== */
.btn-primary, .btn-secondary, .btn-tertiary {
  width: 100%;
  padding: 16px 18px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, #ff5252 0%, #c62828 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255, 50, 50, 0.35);
}
.btn-primary.danger {
  font-size: 22px;
  padding: 22px 18px;
  background: linear-gradient(135deg, #ff1744 0%, #b71c1c 100%);
  animation: pulse-danger 1.4s ease-in-out infinite;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #f5e9e9;
  border: 1px solid rgba(255, 100, 100, 0.25);
}
.btn-tertiary {
  background: transparent;
  color: #9c8585;
  font-size: 14px;
  padding: 12px;
}
.btn-primary:active, .btn-secondary:active {
  transform: scale(0.97);
}
.btn-back {
  align-self: flex-start;
  background: transparent;
  border: none;
  color: #c4a8a8;
  font-size: 14px;
  padding: 4px 0;
  cursor: pointer;
}

@keyframes pulse-danger {
  0%, 100% { box-shadow: 0 4px 20px rgba(255, 50, 50, 0.35); }
  50% { box-shadow: 0 4px 30px rgba(255, 50, 50, 0.7); }
}

/* ===== プレイヤー人数ステッパー ===== */
.player-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 6px;
}
.player-count #player-count-display {
  font-size: 36px;
  font-weight: 800;
  min-width: 60px;
  text-align: center;
  color: #ffd6d6;
}
.btn-step {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 80, 80, 0.2);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
}
.btn-step:active {
  transform: scale(0.92);
}

/* ===== プレイヤー名入力 ===== */
.player-name-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 100, 100, 0.2);
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  margin-bottom: 8px;
}
.player-name-input:focus {
  outline: none;
  border-color: rgba(255, 80, 80, 0.6);
}

/* ===== レイアウト ===== */
.vstack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== ジャンル・タイプ選択ボタン ===== */
.choice-btn {
  padding: 18px 16px;
  border: 2px solid rgba(255, 100, 100, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #f5e9e9;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}
.choice-btn .choice-title {
  display: block;
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 4px;
}
.choice-btn .choice-desc {
  display: block;
  font-size: 12px;
  color: #9c8585;
  font-weight: 400;
}
.choice-btn:active {
  transform: scale(0.98);
  background: rgba(255, 80, 80, 0.15);
}
.choice-btn.genre-btn {
  border-left: 6px solid var(--accent, #ff5252);
  font-size: 18px;
  text-align: center;
}

/* ===== お題プロンプトプレビュー ===== */
.prompt-preview {
  background: rgba(255, 80, 80, 0.12);
  border: 2px solid rgba(255, 80, 80, 0.4);
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  color: #ffd6d6;
  margin: 8px 0;
}

/* ===== 爆弾画面 ===== */
.bomb-screen .bomb-bg {
  position: absolute;
  inset: 0;
  background: #1a0303;
  z-index: 0;
}
.bomb-screen.flash .bomb-bg {
  animation: bg-flash 0.6s ease-in-out infinite;
}
@keyframes bg-flash {
  0%, 100% { background: #1a0303; }
  50% { background: #5a0808; }
}
.bomb-content {
  position: relative;
  z-index: 1;
  justify-content: space-between;
  height: 100%;
}
.prompt {
  font-size: 32px;
  font-weight: 900;
  text-align: center;
  color: #fff;
  padding: 30px 16px;
  margin-top: 20px;
  text-shadow: 0 0 14px rgba(255, 80, 80, 0.6);
  line-height: 1.3;
}
.bomb-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
}
.bomb-image {
  width: 70%;
  max-width: 280px;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 0 30px rgba(255, 80, 80, 0.7));
  animation: bomb-shake 0.4s ease-in-out infinite;
}
.bomb-screen.intense .bomb-image {
  animation: bomb-shake 0.15s ease-in-out infinite;
}
/* ===== 「左の人に渡す」カード（爆弾画面下部） ===== */
.pass-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 16px 6px 14px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(255, 80, 80, 0.18) 0%, rgba(120, 20, 20, 0.35) 100%);
  border: 2px solid rgba(255, 100, 100, 0.55);
  border-radius: 18px;
  box-shadow:
    0 0 30px rgba(255, 50, 50, 0.35),
    inset 0 0 20px rgba(255, 80, 80, 0.1);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  text-align: center;
}

.pass-label {
  font-size: 14px;
  font-weight: 700;
  color: #ffb3b3;
  letter-spacing: 0.08em;
}

.pass-text {
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 80, 80, 0.7);
  letter-spacing: 0.04em;
}

/* ===== 中断ボタン（爆弾画面下部） ===== */
.btn-abort {
  align-self: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #b89898;
  padding: 10px 26px;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 14px;
  letter-spacing: 0.04em;
}
.btn-abort:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.05);
  color: #f5e9e9;
}

/* ===== 各画面の上部に表示するヘッダーロゴ ===== */
.header-logo {
  display: block;
  margin: 14px auto 0;
  height: 16px;
  width: auto;
  opacity: 0.65;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* スタート画面はメインビジュアル扱いで大きく（右上のルールボタンと被らない範囲で） */
#screen-start .header-logo {
  margin: 24px auto 6px;
  height: auto;
  width: 54%;
  max-width: 200px;
  opacity: 1;
  filter: drop-shadow(0 0 12px rgba(255, 80, 80, 0.35));
}

/* ===== 各画面右上のルールボタン ===== */
.btn-rules-corner {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 100, 100, 0.3);
  color: #f5e9e9;
  padding: 7px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.btn-rules-corner:active {
  transform: scale(0.95);
  background: rgba(255, 100, 100, 0.2);
}

/* ===== ルール画面 ===== */
.rules-body {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 100, 100, 0.15);
  border-radius: 16px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rules-h3 {
  font-size: 16px;
  font-weight: 800;
  color: #ffd6d6;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 100, 100, 0.2);
  margin-top: 6px;
}
.rules-h3:first-child {
  margin-top: 0;
}
.rules-list {
  font-size: 14px;
  line-height: 1.7;
  padding-left: 22px;
  color: #f5e9e9;
}
.rules-list li {
  margin-bottom: 6px;
}
.rules-list strong {
  color: #ffd6d6;
  background: rgba(255, 100, 100, 0.18);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ===== BOOM 画面 ===== */
.boom-text {
  text-align: center;
  font-size: 48px;
  font-weight: 900;
  color: #ff5252;
  text-shadow: 0 0 30px rgba(255, 80, 80, 0.8);
  margin: 30px 0 10px;
  animation: boom-pop 0.5s ease-out;
}
.abort-text {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  color: #c4a8a8;
  margin: 30px 0 10px;
}
@keyframes boom-pop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== 得点ルールバナー（スコアボード上部） ===== */
.score-rule-banner {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 140, 0, 0.22) 100%);
  border: 2px solid rgba(255, 200, 0, 0.5);
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;
  margin: 10px 0 6px;
  box-shadow:
    0 0 20px rgba(255, 200, 0, 0.18),
    inset 0 0 12px rgba(255, 200, 0, 0.08);
}
.banner-line-1 {
  font-size: 16px;
  font-weight: 700;
  color: #fff5d6;
  line-height: 1.5;
  margin-bottom: 6px;
}
.banner-line-1 strong {
  color: #ffd700;
  font-size: 19px;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}
.banner-line-2 {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
}
.banner-point {
  display: inline-block;
  font-size: 32px;
  font-weight: 900;
  color: #ffd700;
  text-shadow:
    0 0 14px rgba(255, 215, 0, 0.8),
    0 0 28px rgba(255, 215, 0, 0.4);
  padding: 0 4px;
}

/* 中断時用バナー（控えめな配色） */
.score-rule-banner.aborted {
  background: linear-gradient(135deg, rgba(150, 150, 150, 0.12) 0%, rgba(100, 100, 100, 0.22) 100%);
  border-color: rgba(200, 200, 200, 0.4);
  box-shadow: none;
}
.score-rule-banner.aborted .banner-line-1 {
  color: #c4a8a8;
}
.score-rule-banner.aborted .banner-line-1 strong {
  color: #f5e9e9;
  font-size: 19px;
  text-shadow: none;
}
.score-rule-banner.aborted .banner-line-2 {
  font-size: 16px;
  color: #c4a8a8;
}

/* ===== スコアボード ===== */
.scoreboard {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0;
}
.score-row {
  display: grid;
  grid-template-columns: 1fr auto minmax(36px, auto) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border-left: 4px solid rgba(255, 100, 100, 0.3);
}
.score-row.top {
  border-left-color: #ffd700;
  background: rgba(255, 215, 0, 0.08);
}
.score-name {
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.score-value {
  font-size: 24px;
  font-weight: 900;
  color: #ffd6d6;
  min-width: 36px;
  text-align: center;
}
.score-row.top .score-value {
  color: #ffd700;
}
.score-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.score-btn.minus {
  background: rgba(255, 255, 255, 0.1);
  color: #f5e9e9;
}
.score-btn.plus {
  background: linear-gradient(135deg, #ff5252 0%, #c62828 100%);
  color: #fff;
}
.score-btn:active {
  transform: scale(0.9);
}

@keyframes bomb-shake {
  0%, 100% { transform: rotate(-3deg) scale(1); }
  50% { transform: rotate(3deg) scale(1.05); }
}

/* ===== 心拍ビジュアル（ビープと同テンポ1.1秒） ===== */
.bomb-screen.heartbeat .bomb-image {
  animation: heartbeat-pulse 1.1s ease-in-out infinite;
}
@keyframes heartbeat-pulse {
  0%, 100% { transform: scale(1); }
  20% { transform: scale(1.08); }
  40% { transform: scale(1); }
  60% { transform: scale(1.04); }
}
