* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  font-family: "Noto Sans JP", sans-serif;
  background: #181a1d;
  margin: 0;
  padding: 0;
  color: #e0e0e0;
  line-height: 1.6;
  min-height: 100vh;
}

.footer {
  display: flex;
  justify-content: center;
  margin: 1rem auto 0.5rem;
  padding: 1rem 0;
  width: 100%;
  text-align: center;
  color: #555555;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.divider {
  padding: 0 1rem;
}

h1 {
  position: fixed;
  top: 10px;
  left: 15px;
  font-size: 1.5rem;
  color: #e0e0e0;
  margin: 0;
  padding: 0;
  font-weight: 400;
  letter-spacing: 0.5px;
  z-index: 50;
}

.container {
  max-width: 1800px;
  margin: 0 auto 2rem;
  display: grid;
  grid-template-columns: 3fr 6fr 2fr;
  gap: 2rem;
  background: #181a1d;
  backdrop-filter: blur(10px);
  border-radius: 20px;
  /* box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); */
  padding: 2.5rem;
  overflow-x: hidden; /* 横スクロール防止 */
}

/* メインコンポーネントエリア */
.main-content {
  padding: 1.5rem;
  border-radius: 0 16px 16px 0;
  background: #181a1d;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); */
  overflow-x: hidden; /* 横スクロール防止 */
}

/* ボス情報表示 */
.boss-info-section {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #555555;
}

.boss-info-section .progress-container {
  flex-basis: 100%;
  width: 100%;
}

/* ボス情報ヘッダー（3分割レイアウト） */
.boss-info-header {
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: #181a1d;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); */
}

.boss-level-container,
.boss-name-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.boss-name-container {
  flex: 1;
  padding: 0 1rem;
}

.boss-info-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #79a617;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.boss-level {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  opacity: 1;
  transition: opacity 0s; /* フェードイン: 即座 */
}

.boss-level.fade-out {
  opacity: 0;
  transition: opacity 2s ease-out; /* フェードアウト: 2秒 */
}

.boss-name {
  font-size: 1.5rem;
  color: #ffffff;
  font-weight: 700;
  opacity: 1;
  transition: opacity 0s; /* フェードイン: 即座 */
}

.boss-name.fade-out {
  opacity: 0;
  transition: opacity 2s ease-out; /* フェードアウト: 2秒 */
}

/* 進捗バー拡張 */
.progress-container {
  height: 40px;
  background: #181a1d;
  border-radius: 20px;
  margin: 1.5rem 0;
  position: relative;
  overflow: hidden;
  /* box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5); */
}

#progressBar {
  height: 100%;
  border-radius: 20px;
  transition: width 0.5s ease, margin-left 0.5s ease, background-color 0.5s ease;
  /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); */
}

#progressText {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #555555;
  font-weight: 700;
  font-size: 1.1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* サイドバーの構造調整 */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: #181a1d;
  border-radius: 16px 0 0 16px;
  padding: 1.5rem;
  /* box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); */
}

.sidebar-header {
  margin-bottom: 0.5rem;
}

/* サイドバーの見出し調整 */
.sidebar h2 {
  color: #79a617;
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  font-weight: 700;
}

/* プレイヤーリスト領域 */
.players-list {
  flex-grow: 1;
}

#othersTitle {
  margin-top: 0;
}

/* 自分の情報表示 */
.my-player-info {
  background: #181a1d;
  color: #555555;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-top: 0.75rem;
  font-weight: 700;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); */
  display: flex;
  align-items: center;
  min-height: 2.5rem;
}

/* 単語表示領域 */
#word {
  font-size: 1.8rem;
  line-height: 1.8;
  padding: 1.5rem;
  margin: 0;
  background: #181a1d;
  border-radius: 16px;
  min-height: 100px;
  max-height: 100px;
  display: block;
  /* box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); */
  text-align: left;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: #555555;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  word-break: keep-all;
  word-wrap: normal;
}

#word span {
  display: inline;
  white-space: nowrap;
}

/* カスタムスクロールバー（問題文用） */
#word::-webkit-scrollbar {
  height: 8px;
}

#word::-webkit-scrollbar-track {
  background: #000000;
  border-radius: 10px;
}

#word::-webkit-scrollbar-thumb {
  background: #79a617;
  border-radius: 10px;
}

#word::-webkit-scrollbar-thumb:hover {
  background: #8fb719;
}

/* タイピングセクション（問題欄・入力欄） */
.typing-section {
  border-bottom: 2px solid #555555;
}

/* 入力欄の強化 - 常に表示 */
.input-container {
  margin: 0 0 1.5rem 0;
}

.typing-input {
  width: 100%;
  padding: 1.2rem 1.5rem;
  font-size: 1.2rem;
  font-family: "Noto Sans JP", sans-serif;
  border: none;
  border-radius: 12px;
  background: #181a1d;
  color: #e0e0e0;
  transition: all 0.3s ease;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); */
  display: block;
}

.typing-input:focus {
  outline: none;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); */
  transform: translateY(-2px);
}

.typing-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 休憩中スタイル（ボス不在時の入力欄） */
.typing-input.input-休憩中 {
  background: #181a1d;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); */
  color: #e0e0e0;
}

.typing-input.input-休憩中:focus {
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6); */
}

/* プレイヤー一覧領域 */
#playerStatus {
  background: #181a1d;
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
  /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); */
  max-height: 400px;
  overflow-y: auto;
  color: #555555;
}

/* カスタムスクロールバー（パーティー欄用） */
#playerStatus::-webkit-scrollbar {
  width: 8px;
}

#playerStatus::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

#playerStatus::-webkit-scrollbar-thumb {
  background: #79a617;
  border-radius: 10px;
}

#playerStatus::-webkit-scrollbar-thumb:hover {
  background: #8fb719;
}

.player-progress {
  background: #181a1d;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.8rem;
  display: flex;
  flex-direction: column;
  /* box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); */
}

.player-name {
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* プレイヤーレベルバッジ */
.player-level-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

/* プレイヤーレベルバッジの色（撃破記録と同じ色分け） */
.player-level-badge.defeat-record-tier-1 {
  /* Lv.1-9 */
  color: #666666;
}

.player-level-badge.defeat-record-tier-2 {
  /* Lv.10-19 */
  color: #888888;
}

.player-level-badge.defeat-record-tier-3 {
  /* Lv.20-29 */
  color: #aaaaaa;
}

.player-level-badge.defeat-record-tier-4 {
  /* Lv.30-39 */
  color: #cccccc;
}

.player-level-badge.defeat-record-tier-5 {
  /* Lv.40-49 */
  color: #e0e0e0;
}

.player-level-badge.defeat-record-tier-6 {
  /* Lv.50+ */
  color: #79a617;
}

.word-container {
  background-color: #181a1d;
  padding: 0.6rem;
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1.4;
  overflow-wrap: break-word;
  color: #555555;
}

/* 結果表示と統計情報の横並びコンテナ */
.result-stats-container {
  display: flex;
  gap: 1.5rem;
  margin: 1.5rem 0;
  align-items: stretch;
}

/* 結果表示画面（左側、領域を常に確保） */
.result-area {
  flex: 1;
  background: #181a1d;
  border-radius: 16px;
  padding: 2rem;
  /* box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); */
  position: relative;
  min-height: 280px;
  max-height: 280px;
  overflow-y: auto;
  line-height: 1.4;
  display: block;
  scroll-behavior: smooth;
  color: #555555;
}

/* カスタムスクロールバー（メッセージ欄用） */
.result-area::-webkit-scrollbar {
  width: 8px;
}

.result-area::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

.result-area::-webkit-scrollbar-thumb {
  background: #79a617;
  border-radius: 10px;
}

.result-area::-webkit-scrollbar-thumb:hover {
  background: #8fb719;
}

/* 経過時間と与ダメージ表示（右側） */
.stats-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: center;
  background: #181a1d;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); */
  min-width: 180px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.stat-label {
  color: #79a617;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
}

.stat-value {
  color: #555555;
  font-weight: 700;
  font-size: 1.3rem;
  text-align: center;
  padding: 0.4rem 0.8rem;
  background: #181a1d;
  border-radius: 8px;
  /* box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); */
  min-width: 80px;
}

/* 結果内容がある時のスタイル */
.result-area p {
  margin: 0.5rem 0;
  color: #555555;
  font-weight: 500;
}

/* 与ダメージのハイライト表示（既存の枠の背景色を変更） */
.stat-value.highlighted-damage {
  background: #79a617;
  color: #000000;
}

/* 総経過時間のハイライト表示 */
.stat-value.highlight {
  background: #79a617;
  color: #000000;
}

/* 休憩時間モード（数字部分のみハイライト） */
.stat-item.break-mode .stat-value {
  background: #79a617;
  color: #181a1d;
}

/* タイピング表示のカラースタイル調整 */
/* 確定済み文字の色 */
.confirmed-normal {
  color: #79a617;  /* 緑色 */
  background: none;
  text-decoration: none;
  border-radius: 3px;
}

/* ボス撃破時のみ適用されるスタイル */
.boss-defeated .confirmed-normal {
  color: #79a617;  /* ボス撃破時も緑色 */
  font-weight: 600;
  background: none;
  text-decoration: none;
}

.buffer-correct {
  color: #79a617;  /* 正解は緑色 */
  background: none;
  text-decoration: none;
  border-radius: 3px;
}

.buffer-incorrect {
  color: #b30018;  /* 不正解は赤色 */
  background: none;
  text-decoration: none;
  border-radius: 3px;
}

.remaining {
  color: #555555;  /* 未入力文字は暗い灰色 */
}

/* 接続状況インジケーター */
.connection-status {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  position: relative;
}

.connection-status.connected {
  background: linear-gradient(135deg, #79a617 0%, #5a7d11 100%);
  /* box-shadow: 0 0 12px rgba(121, 166, 23, 0.6); */
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    /* box-shadow: 0 0 12px rgba(121, 166, 23, 0.6); */
  }
  50% {
    /* box-shadow: 0 0 20px rgba(121, 166, 23, 0.8); */
  }
}

.connection-status.disconnected {
  background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
  /* box-shadow: 0 0 12px rgba(229, 62, 62, 0.6); */
}

/* 空のプレイヤーリスト表示 */
.empty-list-message {
  color: #555555;
  font-style: italic;
  padding: 10px;
  text-align: center;
  background-color: #181a1d;
  border-radius: 5px;
}

/* 読み込み中表示のアニメーション */
.dynamic-content {
  color: #555555;
  font-style: italic;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.7;
  }
}

.loaded {
  font-style: normal;
  animation: none;
  transition: all 0.3s ease;
}

/* Ko-fi支援ボタン */
.kofi-control {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
}

/* 音声設定ボタン */
.sound-control {
  position: fixed;
  top: 20px;
  right: 200px;  /* Ko-fiボタンの左隣 */
  z-index: 100;
}

.sound-icon {
  font-size: 20px;
}

.sound-toggle-btn {
  background: linear-gradient(135deg, #ffffff 0%, #f8fff8 100%);
  border: 2px solid #79a617;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  /* box-shadow: 0 4px 16px rgba(121, 166, 23, 0.3); */
  transition: all 0.3s ease;
}

.sound-toggle-btn:hover {
  background: linear-gradient(135deg, #e0ffe0 0%, #f2fff2 100%);
  transform: scale(1.1);
  /* box-shadow: 0 6px 20px rgba(121, 166, 23, 0.4); */
}

.sound-toggle-btn.muted .sound-icon {
  position: relative;
}

.sound-toggle-btn.muted .sound-icon::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 25px;
  background-color: #e53e3e;
  transform: rotate(45deg);
  left: 9px;
  top: -2px;
  /* box-shadow: 0 2px 4px rgba(229, 62, 62, 0.3); */
}

/* 告知メッセージバーのスタイル（通常配置） */
.announcement-bar {
  position: static;
  width: 100%;
  background: #181a1d;
  color: #ffffff;
  text-align: center;
  padding: 0.5rem 1rem;
  font-weight: 700;
  font-size: 0.95rem;
  /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); */
  font-family: "Zen Maru Gothic", "Noto Sans JP", sans-serif;
}

/* タイマーバーのスタイル（画面最下部に固定） */
.timer-bar-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 8px;
  z-index: 1000;
  text-align: center;
  /* box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15); */
  padding-bottom: env(safe-area-inset-bottom);
}

.timer-bar-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  background: #181a1d;
  overflow: hidden;
}

.timer-bar-left, .timer-bar-right {
  position: absolute;
  height: 100%;
  background: #79a617;
  transition: width 0.1s linear;
  /* box-shadow: 0 0 10px rgba(121, 166, 23, 0.6); */
}

.timer-bar-left {
  left: 0;
  width: 50%;
}

.timer-bar-right {
  right: 0;
  width: 50%;
}

.timer-text {
  display: none;
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: #333;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 2px 8px;
  border-radius: 10px;
}

/* 撃破記録サイドバー */
.defeat-records-sidebar {
  background: transparent;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  max-height: 600px;
}

.defeat-records-sidebar h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #79a617;
  text-align: center;
  border-bottom: 2px solid #555555;
  padding-bottom: 0.5rem;
  flex-shrink: 0;
}

.defeat-records-list {
  flex: 1;
  overflow: hidden;
}

/* 撃破記録テーブルラッパー */
.defeat-records-table-wrapper {
  max-height: 100%;
  overflow-y: auto;
}

/* 撃破記録テーブル */
.defeat-records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.defeat-records-table thead {
  position: sticky;
  top: 0;
  background: #181a1d;
  z-index: 1;
}

.defeat-records-table th {
  padding: 0.5rem 0.3rem;
  text-align: center;
  color: #555555;
  font-weight: 600;
  font-size: 0.8rem;
  border-bottom: 2px solid #555555;
}

.defeat-records-table td {
  padding: 1rem 0.3rem;
  text-align: center;
  color: #555555;
  border-bottom: 1px solid #555555;
}

.defeat-record-row {
  transition: background-color 0.2s;
}

.defeat-record-row:hover {
  background: #242730;
}

/* 撃破記録のレベル別色分け（灰色→白のグラデーション） */
.defeat-record-tier-1 td {
  /* Lv.2-9 */
  color: #666666;
}

.defeat-record-tier-2 td {
  /* Lv.10-19 */
  color: #888888;
}

.defeat-record-tier-3 td {
  /* Lv.20-29 */
  color: #aaaaaa;
}

.defeat-record-tier-4 td {
  /* Lv.30-39 */
  color: #cccccc;
}

.defeat-record-tier-5 td {
  /* Lv.40-49 */
  color: #e0e0e0;
}

.defeat-record-tier-6 td {
  /* Lv.50: ゲームクリア */
  color: #79a617;
}

/* 撃破記録のスクロールバーカスタマイズ */
.defeat-records-table-wrapper::-webkit-scrollbar {
  width: 8px;
}

.defeat-records-table-wrapper::-webkit-scrollbar-track {
  background: #181a1d;
  border-radius: 10px;
}

.defeat-records-table-wrapper::-webkit-scrollbar-thumb {
  background: #79a617;
  border-radius: 10px;
}

.defeat-records-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #8bb71f;
}

/* レスポンシブデザイン */

/* 中間サイズ（タブレット・小型ラップトップ）用 */
@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    max-width: 95%;
    padding: 2rem;
    gap: 1.5rem;
    overflow-x: hidden; /* 横スクロール防止 */
  }

  #word {
    font-size: 1.5rem;
    padding: 1.2rem;
    min-height: 90px;
    max-height: 90px;
    overflow-x: auto; /* 横スクロール有効 */
    overflow-y: hidden;
    white-space: nowrap;
    word-break: keep-all;
    word-wrap: normal;
    max-width: 100%; /* 親要素からはみ出さない */
  }

  .boss-info-header {
    gap: 0.8rem;
    padding: 0.8rem;
  }

  .boss-level,
  .boss-name {
    font-size: 1.1rem;
  }

  .typing-input {
    padding: 1.1rem;
    font-size: 1.1rem;
  }

  .result-area {
    min-height: 280px;
    max-height: 280px;
  }

  .result-stats-container {
    gap: 1.2rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }
}

/* モバイル用 */
@media (max-width: 768px) {
  .timer-bar-container {
    height: 6px;
  }

  h1 {
    font-size: 1rem;
    top: 10px;
    left: 10px;
  }

  .announcement-bar {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }

  .kofi-control {
    top: 75px;  /* 音声ボタンの下に配置 */
    right: 10px;
  }

  .sound-control {
    right: 20px;  /* スマホでは元の位置に戻す */
  }

  .container {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
    margin: 0.5rem 1rem 1rem;
    border-radius: 16px;
  }

  .sidebar {
    order: 2;
  }

  .main-content {
    order: 1;
  }

  .defeat-records-sidebar {
    order: 3;
  }

  .boss-info-section {
    flex-direction: column;
    align-items: stretch;
  }

  .boss-info-section .progress-container {
    display: block !important;
    flex-basis: auto;
    width: 100%;
  }

  .boss-info-header {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .boss-name-container {
    border-left: none;
    border-right: none;
    border-top: 2px solid #c7d2fe;
    border-bottom: 2px solid #c7d2fe;
    padding: 0.5rem 0;
  }

  .boss-level,
  .boss-name {
    font-size: 1rem;
  }

  .boss-name {
    font-size: 1.1rem;
  }

  #progressText {
    font-size: 0.9rem;
  }

  #word {
    font-size: 1.3rem;
    padding: 1rem;
    margin: 1rem 0;
    min-height: 80px;
    max-height: 80px;
  }

  .typing-input {
    padding: 1rem;
    font-size: 1rem;
  }

  .main-content, .sidebar {
    padding: 1rem;
  }

  .result-area {
    min-height: 300px;
    max-height: 300px;
  }

  .sound-toggle-btn {
    width: 45px;
    height: 45px;
  }

  .result-stats-container {
    flex-direction: column;
  }

  .stats-section {
    flex-direction: row;
    gap: 1rem;
    padding: 1rem;
    min-width: auto;
  }

  .stat-item {
    flex: 1;
  }

  .stat-label {
    font-size: 0.9rem;
  }

  .stat-value {
    font-size: 1.3rem;
    min-width: auto;
  }
}

/* さらに小さい画面用 */
@media (max-width: 480px) {
  .container {
    padding: 1rem;
    margin: 0.5rem;
  }

  h1 {
    font-size: 0.9rem;
  }

  .boss-info-label {
    font-size: 0.7rem;
  }

  .boss-level,
  .boss-name {
    font-size: 0.95rem;
  }

  .boss-name {
    font-size: 1rem;
  }

  #word {
    font-size: 1.2rem;
    padding: 0.8rem;
    max-height: 70px;
  }

  .result-area {
    min-height: 240px;
    max-height: 240px;
  }
}

/* ========================================
   エントリーモーダル
======================================== */
.entry-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
  padding: 2rem;
  box-sizing: border-box;
  overflow-y: auto;
}

/* ぼかし効果のサポート */
@supports (backdrop-filter: blur(8px)) {
  .entry-modal {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

.entry-modal-content {
  max-width: 1000px;
  width: 100%;
  animation: slideIn 0.3s ease-out;
}

.entry-modal-content h2 {
  margin: 0 0 2.5rem 0;
  color: #e0e0e0;
  font-size: 2.5rem;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.entry-main {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  justify-content: center;
}

.entry-info {
  flex: 1;
  max-width: 520px;
  text-align: right;
}

.entry-section {
  margin-bottom: 1.75rem;
}

.entry-section h3 {
  margin: 0 0 0.625rem 0;
  color: #79a617;
  font-size: 1.3125rem;
  text-align: right;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.entry-section ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
  text-align: right;
}

.entry-section li {
  margin-bottom: 0.5rem;
  line-height: 1.65;
  color: #e0e0e0;
  font-size: 1.0625rem;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

.entry-form {
  flex-shrink: 0;
  width: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.entry-form label {
  display: block;
  margin-bottom: 0.75rem;
  color: #e0e0e0;
  font-weight: 600;
  font-size: 1rem;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.entry-form input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.9);
  text-align: center;
}

.entry-form input:focus {
  outline: none;
  border-color: #79a617;
  background: white;
  /* box-shadow: 0 0 0 3px rgba(121, 166, 23, 0.2); */
}

.entry-error {
  padding: 0.875rem;
  margin: 0.875rem 0;
  color: #79a617;
  font-weight: 600;
  text-align: center;
  font-size: 0.9375rem;
}

.entry-hint {
  display: block;
  margin-top: 0.5rem;
  margin-bottom: 0.875rem;
  color: #9ba2a9;
  font-size: 0.875rem;
  line-height: 1.4;
}

.truename-label {
  margin-top: 1.5rem;
}

.entry-join-button {
  width: 100%;
  padding: 1rem 1.5rem;
  margin-top: 1.25rem;
  background: linear-gradient(135deg, #79a617 0%, #5a7d11 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.125rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  /* box-shadow: 0 4px 14px rgba(121, 166, 23, 0.6); */
}

.entry-join-button:hover {
  background: linear-gradient(135deg, #5a7d11 0%, #3f5c0c 100%);
  /* box-shadow: 0 6px 20px rgba(121, 166, 23, 0.8); */
  transform: translateY(-2px);
}

.entry-join-button:active {
  transform: translateY(0);
  /* box-shadow: 0 2px 10px rgba(121, 166, 23, 0.4); */
}

.entry-modal.hidden {
  display: none;
}

/* アニメーション */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* レスポンシブ対応 */
@media (max-width: 900px) {
  .entry-main {
    flex-direction: column;
    gap: 2rem;
  }

  .entry-form {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .entry-modal {
    padding: 1.5rem;
    justify-content: flex-start;
    padding-top: 3rem;
    padding-bottom: 5rem;
  }

  .entry-modal-content h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
  }

  .entry-section h3 {
    font-size: 1.25rem;
  }

  .entry-section li {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .entry-modal {
    padding: 1rem;
    justify-content: flex-start;
    padding-top: 2rem;
    padding-bottom: 4rem;
  }

  .entry-modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .entry-section {
    margin-bottom: 1.5rem;
  }

  .entry-section h3 {
    font-size: 1.125rem;
  }

  .entry-section li {
    font-size: 0.95rem;
  }

  .entry-form label {
    font-size: 0.9375rem;
  }

  .entry-form input,
  .entry-join-button {
    font-size: 0.9375rem;
  }
}

/* 結果コピー用モーダル */
.result-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
  padding: 2rem;
  box-sizing: border-box;
  overflow-y: auto;
}

@supports (backdrop-filter: blur(8px)) {
  .result-modal {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

.result-modal-content {
  max-width: 600px;
  width: 100%;
  background: #181a1d;
  border-radius: 12px;
  padding: 2rem;
  box-sizing: border-box;
  animation: slideIn 0.3s ease-out;
  border: 2px solid #555555;
}

.result-modal-content h2 {
  margin: 0 0 1.5rem 0;
  color: #e0e0e0;
  font-size: 1.75rem;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.result-modal-body {
  margin-bottom: 1.5rem;
}

.result-text {
  background: #0f1012;
  border: 1px solid #555555;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  color: #e0e0e0;
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Noto Sans JP", sans-serif;
  max-height: 300px;
  overflow-y: auto;
}

.result-text::-webkit-scrollbar {
  width: 8px;
}

.result-text::-webkit-scrollbar-track {
  background: #0f1012;
  border-radius: 4px;
}

.result-text::-webkit-scrollbar-thumb {
  background: #555555;
  border-radius: 4px;
}

.result-text::-webkit-scrollbar-thumb:hover {
  background: #666666;
}

.player-list-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #e0e0e0;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
}

.player-list-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.result-modal-footer {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.result-button {
  flex: 1;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Noto Sans JP", sans-serif;
}

.result-button-copy {
  background: linear-gradient(135deg, #79a617 0%, #5a7d11 100%);
  color: white;
}

.result-button-copy:hover {
  background: linear-gradient(135deg, #5a7d11 0%, #3f5c0c 100%);
  transform: translateY(-2px);
}

.result-button-copy:active {
  transform: translateY(0);
}

.result-button-ok {
  background: #333333;
  color: #e0e0e0;
}

.result-button-ok:hover {
  background: #444444;
  transform: translateY(-2px);
}

.result-button-ok:active {
  transform: translateY(0);
}

/* トースト通知 */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: #79a617;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  z-index: 10000;
  animation: toastSlideIn 0.3s ease-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.toast.toast-fade-out {
  animation: toastFadeOut 0.3s ease-out forwards;
}

@keyframes toastFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .result-modal {
    padding: 1.5rem;
  }

  .result-modal-content {
    padding: 1.5rem;
  }

  .result-modal-content h2 {
    font-size: 1.5rem;
  }

  .result-text {
    font-size: 0.9rem;
  }

  .result-button {
    font-size: 0.9rem;
    padding: 0.75rem 1.25rem;
  }

  .toast {
    bottom: 80px;
    font-size: 0.9rem;
    padding: 0.875rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .result-modal {
    padding: 1rem;
  }

  .result-modal-content {
    padding: 1.25rem;
  }

  .result-modal-content h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .result-text {
    font-size: 0.85rem;
    padding: 0.875rem;
    max-height: 250px;
  }

  .result-modal-footer {
    flex-direction: column;
    gap: 0.75rem;
  }

  .result-button {
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
  }

  .player-list-toggle {
    font-size: 0.875rem;
  }

  .toast {
    bottom: 70px;
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
  }
}