/* 共通のリセット・レイアウト・モバイル対応ベース */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", system-ui,
    -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/*
 * 高さは「実際に見えている高さ(dvh)」ちょうどにする。
 * iOS の Safari/Chrome では 100vh がツールバーを除いた最大の高さになり、
 * 下部(テーマ切り替え)が画面外に押し出されるため、dvh を後に書いて優先させる。
 */
.app {
  height: 100vh; /* dvh 非対応ブラウザ向けの代替 */
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

.genre-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  flex-shrink: 0;
}

.genre-btn {
  border: none;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

/* タップ領域: 画面の主要部分を占める、見た目上は「ボタン」に見せない全面タップ面 */
.tap-area {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding: 24px;
  text-align: center;
}

.phrase {
  margin: 0;
  max-width: 88vw;
  opacity: 0;
  white-space: pre-line; /* セリフ本文中の改行(\n)をそのまま改行として表示する */
}

body.has-played .phrase {
  opacity: 1;
}

.hint {
  margin: 0;
  transition: opacity 0.25s ease;
}

body.has-played .hint {
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.status {
  min-height: 1.5em;
  font-size: 13px;
  text-align: center;
  flex-shrink: 0;
}
