/* Tournament */
.tournament-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.92);
  z-index: 200;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.tournament-overlay.open { display: block; }
.tournament-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 16px 12px;
}
.tournament-content h2 {
  text-align: center;
  color: #f39c12;
  font-size: 1.3em;
  margin-bottom: 16px;
  text-shadow: 0 0 15px rgba(243,156,18,0.5);
}
.bracket {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.bracket-round-label {
  text-align: center;
  color: #f39c12;
  font-weight: bold;
  font-size: 0.9em;
  margin: 10px 0 4px;
  border-bottom: 1px solid #333;
  padding-bottom: 4px;
}
.bracket-match {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.8em;
}
.bracket-match.active {
  border-color: #e94560;
  box-shadow: 0 0 10px rgba(233,69,96,0.3);
}
.bracket-match.done {
  opacity: 0.85;
}
.bracket-fighter {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}
.bracket-fighter.winner {
  color: #f1c40f;
  font-weight: bold;
}
.bracket-fighter.loser {
  color: #666;
}
.bracket-vs {
  text-align: center;
  color: #e94560;
  font-size: 0.8em;
}
.champion-banner {
  text-align: center;
  padding: 20px;
  margin: 10px 0;
  background: linear-gradient(135deg, #f39c12, #e67e22);
  border-radius: 12px;
  animation: pulse 1.5s infinite;
}
.champion-banner h3 {
  font-size: 1.4em;
  color: #fff;
  margin-bottom: 4px;
}
.champion-banner p {
  color: #fff;
  font-size: 1em;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(243,156,18,0.5); }
  50% { box-shadow: 0 0 40px rgba(243,156,18,0.8); }
}
.close-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1em;
  cursor: pointer;
  margin-top: 12px;
  -webkit-appearance: none;
  touch-action: manipulation;
}
.close-btn:active { background: #555; }

.pick-overlay-content {
  max-width: 400px;
}
.pick-heading {
  color: #e94560;
  margin-bottom: 8px;
}
.pick-subtitle {
  color: #aaa;
  font-size: 0.85em;
  margin-bottom: 8px;
}
.pick-counter {
  color: #ffd700;
  font-size: 0.9em;
  margin-bottom: 8px;
}
.pick-search {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #333;
  background: #0f3460;
  color: #fff;
  font-size: 1em;
  margin-bottom: 8px;
}
.pick-list {
  max-height: 350px;
  overflow-y: auto;
  border: 1px solid #333;
  border-radius: 6px;
  background: #0a0a1a;
  -webkit-overflow-scrolling: touch;
}
.pick-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.pick-item {
  padding: 10px 12px;
  border-bottom: 1px solid #1a1a2e;
  color: #ccc;
  font-size: 0.95em;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.pick-item:active { background: #1a1a2e; }
.pick-item.selected {
  background: #e94560;
  color: #fff;
  font-weight: bold;
}

.tournament-log {
  background: #0d1117;
  border: 1px solid #0f3460;
  border-radius: 10px;
  padding: 10px;
  max-height: 350px;
  overflow-y: auto;
  font-size: 0.75em;
  line-height: 1.5;
  margin-top: 10px;
  -webkit-overflow-scrolling: touch;
}

.bracket-svg-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 14px;
  background: #0a0f1a;
  border: 1px solid #0f3460;
  border-radius: 10px;
  padding: 12px 8px 10px;
}

/* トーナメント表 折りたたみ */
.bracket-toggle {
  margin-top: 12px;
}
.bracket-toggle-summary {
  display: block;
  text-align: center;
  color: #f39c12;
  font-weight: bold;
  font-size: 0.9em;
  cursor: pointer;
  padding: 10px;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 8px;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
}
.bracket-toggle-summary::-webkit-details-marker { display: none; }
.bracket-toggle-summary::before { content: '▶ '; }
.bracket-toggle[open] > .bracket-toggle-summary::before { content: '▼ '; }
.bracket-toggle[open] > .bracket-toggle-summary {
  border-radius: 8px 8px 0 0;
}
.bracket-toggle > .bracket {
  margin-top: 0;
  border: 1px solid #0f3460;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 8px;
  background: rgba(22,33,62,0.5);
}

/* 保存済み対戦ログ */
.saved-logs {
  margin-top: 8px;
}
.saved-log-item {
  margin-bottom: 4px;
}
.saved-log-summary {
  display: block;
  cursor: pointer;
  padding: 8px 10px;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 6px;
  font-size: 0.75em;
  color: #aaa;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
}
.saved-log-summary::-webkit-details-marker { display: none; }
.saved-log-summary::before { content: '▶ '; color: #f39c12; }
.saved-log-item[open] > .saved-log-summary::before { content: '▼ '; color: #f39c12; }
.saved-log-item[open] > .saved-log-summary {
  border-radius: 6px 6px 0 0;
  color: #e0e0e0;
}
.saved-log-content {
  margin-top: 0;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 250px;
  overflow-y: auto;
}
.log-skipped {
  color: #555;
  font-size: 0.85em;
  padding: 4px 0;
  text-align: center;
}
