/* Team Mode Styles */

/* Team Colors */
.team-red { --team-color: #ef4444; }
.team-blue { --team-color: #3b82f6; }
.team-green { --team-color: #22c55e; }
.team-yellow { --team-color: #eab308; }

/* Team Group in Waiting Room */
.team-group {
  background: var(--bg-light);
  border-radius: 12px;
  border-left: 4px solid var(--team-color, var(--primary));
  padding: 12px;
  margin-bottom: 12px;
}

.team-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.team-icon {
  font-size: 1.2rem;
}

.team-name {
  font-weight: 600;
  flex: 1;
}

.team-player-count {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.captain-badge {
  background: var(--warning);
  color: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.team-players {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Player Pool (Captain Pick) */
.player-pool {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 15px;
  margin-top: 15px;
  border: 2px dashed var(--border);
}

.pool-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 10px;
  font-weight: 500;
}

.player-chip.unassigned {
  background: var(--bg-light);
  border: 2px dashed var(--border);
  cursor: pointer;
}

.player-chip.unassigned:hover {
  border-color: var(--primary);
  background: var(--bg-card);
}

/* Team Score Bar */
.team-score-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  padding: 10px;
  background: var(--bg-light);
  border-radius: 10px;
}

.team-score-item {
  flex: 1;
  position: relative;
  height: 40px;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 12px;
}

.team-score-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  opacity: 0.3;
  transition: width 0.5s ease;
  border-radius: 8px;
}

.team-score-icon {
  position: relative;
  font-size: 1.1rem;
  margin-right: 8px;
}

.team-score-value {
  position: relative;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Leaderboard Tabs */
.leaderboard-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.leaderboard-tab {
  padding: 10px 20px;
  border-radius: 25px;
  background: var(--bg-card);
  border: none;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.leaderboard-tab:hover {
  background: var(--bg-light);
  color: var(--text);
}

.leaderboard-tab.active {
  background: var(--primary);
  color: white;
}

.leaderboard-content {
  max-height: 400px;
  overflow-y: auto;
}

/* Team Leaderboard Item */
.leaderboard-item.team-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Team Podium */
.team-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 15px;
  margin: 30px 0;
  min-height: 200px;
}

.team-podium .podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.team-podium .podium-place.podium-reveal {
  opacity: 1;
  transform: translateY(0);
}

.team-podium .podium-info {
  text-align: center;
  margin-bottom: 10px;
}

.team-podium .podium-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 5px;
}

.team-podium .podium-name {
  font-weight: 600;
  font-size: 1rem;
}

.team-podium .podium-score {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.team-podium .podium-bar {
  width: 80px;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
}

.team-podium .podium-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.team-podium .podium-1 .podium-bar {
  box-shadow: 0 0 20px var(--podium-color, var(--warning));
}

/* Team Final Screen - Override parent podium flex */
.podium.team-final {
  display: block;
  height: auto;
}

/* Individual Podium Header in Team Mode */
.individual-podium {
  margin-top: 20px;
}

h3[data-i18n="team_rankings"],
h3[data-i18n="top_players"] {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Team info on question header */
.player-team-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
}

/* Team Badge on Player Waiting Screen */
.team-badge,
.player-team-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 25px;
  border-radius: 30px;
  color: white;
  font-weight: 600;
  margin: 15px 0;
  font-size: 1.2rem;
  animation: teamBadgeIn 0.5s ease;
}

.player-team-badge #player-team-icon {
  font-size: 1.5rem;
}

@keyframes teamBadgeIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* Team Streak Notification */
.team-streak-bonus {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--warning);
  color: var(--bg);
  padding: 20px 40px;
  border-radius: 16px;
  font-size: 1.5rem;
  font-weight: bold;
  z-index: 1000;
  animation: streakPop 0.5s ease;
}

@keyframes streakPop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.2); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Captain Pick Mode */
.captain-pick-mode .player-chip {
  cursor: pointer;
  transition: all 0.2s;
}

.captain-pick-mode .player-chip:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.pick-turn-indicator {
  background: var(--secondary);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  margin-bottom: 15px;
  display: inline-block;
}

/* Remove player button */
.remove-player-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  border: none;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  line-height: 1;
}

.player-chip:hover .remove-player-btn {
  opacity: 1;
}

.remove-player-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* Captain Pick Overlay (Player View) - Light Theme */
.captain-pick-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
}

.captain-pick-content {
  background: #f1f5f9;
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  animation: captainPickIn 0.4s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

@keyframes captainPickIn {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.captain-pick-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.captain-pick-icon {
  font-size: 2.5rem;
  animation: crownBounce 1s ease infinite;
}

@keyframes crownBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.captain-pick-title {
  font-size: 1.8rem;
  font-weight: bold;
  color: #1e293b;
}

.captain-pick-team {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 25px;
  border-radius: 25px;
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.captain-pick-hint {
  color: #64748b;
  margin-bottom: 15px;
  font-size: 0.95rem;
}

.captain-pick-players {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  max-height: 350px;
  overflow-y: auto;
  padding: 5px;
}

.captain-pick-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 10px;
  background: white;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid #e2e8f0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  min-height: 90px;
}

.captain-pick-player:hover {
  background: var(--primary);
  transform: scale(1.05);
  border-color: var(--primary);
}

.captain-pick-player.picked {
  background: var(--secondary);
  border-color: var(--secondary);
}

.captain-pick-avatar {
  font-size: 2.2rem;
}

.captain-pick-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1e293b;
  text-align: center;
  word-break: break-word;
  line-height: 1.2;
}

.captain-pick-player:hover .captain-pick-name,
.captain-pick-player.picked .captain-pick-name {
  color: white;
}

/* Captain pick loading spinner */
.captain-pick-loader {
  width: 50px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 8px solid transparent;
  border-right-color: var(--primary);
  position: relative;
  animation: captainPickSpin 1s infinite linear;
  margin: 20px auto;
}

.captain-pick-loader:before,
.captain-pick-loader:after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: inherit;
  animation: inherit;
  animation-duration: 2s;
}

.captain-pick-loader:after {
  animation-duration: 4s;
}

@keyframes captainPickSpin {
  100% { transform: rotate(1turn); }
}

@keyframes captainNotifyIn {
  0% { transform: translateX(-50%) scale(0); opacity: 0; }
  50% { transform: translateX(-50%) scale(1.1); }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

@keyframes captainNotifyOut {
  0% { transform: translateX(-50%) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-20px); opacity: 0; }
}

.captain-pick-loading-text {
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
  margin-top: 10px;
}

/* Responsive */
@media (max-width: 600px) {
  .team-score-bar {
    flex-direction: column;
    gap: 8px;
  }

  .team-podium {
    gap: 8px;
  }

  .team-podium .podium-bar {
    width: 60px;
  }

  .leaderboard-tabs {
    flex-wrap: wrap;
  }
}


/* Team Members in Player Waiting Screen */
.player-team-members {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 15px;
  margin: 15px auto;
  max-width: 300px;
  text-align: left;
}

.player-team-members-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-align: center;
}

.player-team-member {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  margin-bottom: 4px;
}

.player-team-member:last-child {
  margin-bottom: 0;
}

.player-team-member.is-me {
  background: var(--primary);
  color: white;
}

.player-team-member-avatar {
  font-size: 1.2rem;
}

.player-team-member-name {
  flex: 1;
  font-size: 0.95rem;
}

.player-team-member .captain-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
}
