/* =========================
   CHALLS CSS - FECOD 2026 REBRAND
   Colores: Negro #001729, Rojo #1E5A9A, Azul oscuro #002135, Azul medio #193C6D
========================= */

/* =========================
   CHAT FLOTANTE
========================= */
.chall-chat {
  position: fixed !important;
  bottom: 24px !important;
  top: auto !important;
  right: 24px !important;
  width: 340px;
  height: 420px;
  background: #001729;
  border: 1px solid rgba(173,34,33,0.3);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  overflow: visible;
  transition: all .25s ease;
}

.chall-chat.hidden {
  display: none;
}

.chall-chat.minimized {
  height: 56px;
}

.chat-header {
  height: 56px;
  background: #002135;
  border-radius: 14px 14px 0 0;
  display: flex;
  align-items: center;
  padding: 0 14px;
  justify-content: space-between;
  position: relative;
}

.chat-title {
  font-family: 'Bakbak One', sans-serif;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot-live {
  width: 8px;
  height: 8px;
  background: #1E5A9A;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: .4 }
  50% { opacity: 1 }
  100% { opacity: .4 }
}

.chat-actions button {
  background: none;
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
  margin-left: 6px;
  transition: color .2s;
}

.chat-actions button:hover {
  color: #1E5A9A;
}

.chat-unread {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #1E5A9A;
  color: #fff;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: bold;
  animation: pop .2s ease;
}

@keyframes pop {
  0% { transform: scale(0.6); opacity: 0 }
  100% { transform: scale(1); opacity: 1 }
}

.chat-user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.chat-user .captain {
  color: #1E5A9A;
  margin-left: 4px;
}

/* =========================
   MENSAJES CHAT
========================= */
.chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background: #001729;
}

.chat-messages div {
  margin-bottom: 8px;
  font-size: 14px;
}

.chat-msg {
  display: flex;
  margin-bottom: 8px;
}

.chat-msg .bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-msg .sender {
  display: block;
  font-size: 11px;
  opacity: 0.7;
  margin-bottom: 2px;
}

/* TEAM A */
.chat-msg.team-a {
  justify-content: flex-start;
}
.chat-msg.team-a .bubble {
  background: linear-gradient(135deg, #193C6D, #002135);
  color: #fff;
  border-top-left-radius: 4px;
}

/* TEAM B */
.chat-msg.team-b {
  justify-content: flex-end;
}
.chat-msg.team-b .bubble {
  background: linear-gradient(135deg, #1E5A9A, #8a1b1a);
  color: #fff;
  border-top-right-radius: 4px;
}

/* SISTEMA */
.chat-msg.team-neutral {
  justify-content: center;
}
.chat-msg.team-neutral .bubble {
  background: rgba(255,255,255,0.08);
  color: #ddd;
  font-size: 12px;
  text-align: center;
}

.chat-msg.history-msg {
  opacity: 0.7;
}

.bubble-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  opacity: 0.75;
  margin-bottom: 4px;
}

.bubble-header .time {
  font-size: 10px;
  opacity: 0.6;
}

.chat-typing {
  font-size: 12px;
  color: #888;
  padding: 4px 12px;
}

.chat-form {
  padding: 10px;
  border-top: 1px solid rgba(173,34,33,0.2);
  background: #002135;
  border-radius: 0 0 14px 14px;
}

.chat-form input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(173,34,33,0.3);
  background: #001729;
  color: #fff;
  transition: border-color .2s;
}

.chat-form input:focus {
  outline: none;
  border-color: #1E5A9A;
}

.chat-preview {
  font-size: 12px;
  color: #bdbdbd;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.chall-chat.minimized .chat-preview {
  display: block;
}

.chall-chat:not(.minimized) .chat-preview {
  display: none;
}

/* =========================
   SORTEO DE MAPAS
========================= */
.map-slot {
  margin-top: 30px;
  text-align: center;
}

.slot-window {
  width: 260px;
  height: 80px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  border: 2px solid #1E5A9A;
  background: #002135;
  position: relative;
}

.slot-reel {
  position: absolute;
  top: 0;
  width: 100%;
}

.slot-item {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bakbak One', sans-serif;
  font-weight: 400;
  font-size: 18px;
  color: #fff;
}

.slot-item img {
  height: 48px;
  margin-right: 10px;
}

.slot-result {
  margin-top: 12px;
  font-family: 'Bakbak One', sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: #1E5A9A;
}

.drawn-maps {
  margin-top: 40px;
}

.section-title {
  font-family: 'Bakbak One', sans-serif;
  margin-bottom: 16px;
  font-weight: 400;
  text-transform: uppercase;
}

/* =========================
   GRID DE MAPAS
========================= */
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.maps-container {
  display: flex;
  gap: 16px;
  margin-top: 20px;
}

.map-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #002135;
  box-shadow: 0 0 0 1px rgba(173,34,33,.35);
  transition: transform .2s ease, box-shadow .2s ease;
}

.map-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 2px rgba(173,34,33,.6);
}

.map-card.selected {
  outline: 2px solid #1E5A9A;
}

.map-card img {
  width: 100%;
  height: 90px;
  object-fit: cover;
}

.map-img-wrapper {
  width: 100%;
  height: 160px;
}

.map-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.map-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(0,23,41,.95), rgba(0,23,41,.5), transparent);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.map-overlay {
  position: absolute;
  inset: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.map-name {
  font-family: 'Bakbak One', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0,0,0,.8);
}

.map-mode {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

/* Colores por modo */
.map-mode.HP { background: rgba(25,60,109,.85); color: #fff; }
.map-mode.SND { background: rgba(173,34,33,.85); color: #fff; }
.map-mode.OVR { background: rgba(138,27,26,.85); color: #fff; }

/* =========================
   VS CARD
========================= */
.chall-vs-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #001729, #002135);
  border: 1px solid rgba(173,34,33,0.3);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
}

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.team-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.team-logo.placeholder {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background: linear-gradient(135deg, #002135, #001729);
  border: 1px solid rgba(173,34,33,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bakbak One', sans-serif;
  font-size: 36px;
  font-weight: 400;
  color: #1E5A9A;
}

.vs {
  font-family: 'Bakbak One', sans-serif;
  font-size: 32px;
  font-weight: 400;
  color: #1E5A9A;
  opacity: 0.9;
}

/* =========================
   SELECTOR DE JUGADORES
========================= */
.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.player-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px,1fr));
  gap: 10px;
}

.player-selector.pro {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.player-option {
  background: #002135;
  border: 1px solid rgba(255,255,255,.08);
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s ease;
}

.player-option input {
  display: none;
}

.player-option:has(input:checked) {
  border-color: #1E5A9A;
  box-shadow: 0 0 0 1px rgba(173,34,33,.5);
}

.player-card {
  position: relative;
  background: linear-gradient(135deg, #001729, #002135);
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.08);
  transition: all .2s ease;
  user-select: none;
}

.player-card:hover {
  transform: translateY(-2px);
  border-color: rgba(173,34,33,.4);
}

.player-card input {
  display: none;
}

.player-name {
  font-weight: 700;
  font-size: 15px;
  color: #e5e7eb;
  letter-spacing: .2px;
}

.player-card:has(input:checked) {
  background: linear-gradient(135deg, #3d1515, #5a1f1f);
  border-color: #1E5A9A;
  box-shadow: 0 0 0 1px rgba(173,34,33,.6);
}

.player-card:has(input:checked) .player-name {
  color: #1E5A9A;
}

.player-card:has(input:checked)::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 16px;
  font-weight: 900;
  color: #1E5A9A;
}

.player-card input:disabled + .player-name {
  opacity: .4;
}

.player-card.disabled {
  opacity: .4;
  cursor: not-allowed;
}

.player-card.disabled:hover {
  transform: none;
  border-color: rgba(255,255,255,.08);
}

.captain {
  color: #1E5A9A;
  font-size: 12px;
}

/* =========================
   BOTONES
========================= */
.btn-pro {
  border: none;
  border-radius: 14px;
  padding: 14px 26px;
  font-family: 'Bakbak One', sans-serif;
  font-weight: 400;
  letter-spacing: .6px;
  cursor: pointer;
  transition: all .2s ease;
  text-transform: uppercase;
}

.btn-accept {
  background: linear-gradient(135deg, #1E5A9A, #c93a39);
  color: #fff;
  box-shadow: 0 10px 30px rgba(173,34,33,.35);
}

.btn-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(173,34,33,.5);
}

.btn-accept:active {
  transform: translateY(0);
}

.btn-dispute {
  background: linear-gradient(135deg, #193C6D, #002135);
  color: #fff;
  border-radius: 14px;
  padding: 12px 22px;
  font-family: 'Bakbak One', sans-serif;
  font-weight: 400;
  letter-spacing: .5px;
  box-shadow: 0 10px 30px rgba(25,60,109,.4);
}

.btn-dispute:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(25,60,109,.6);
}

/* =========================
   REPORT RESULTADO
========================= */
.report-card {
  background: rgba(0,23,41,0.95);
  border: 1px solid rgba(173,34,33,0.3);
  border-radius: 14px;
  padding: 20px;
  max-width: 520px;
  margin-top: 30px;
}

.report-card.pro {
  background: radial-gradient(circle at top, #002135, #001729);
  border-radius: 18px;
  padding: 24px;
  max-width: 520px;
  margin-top: 30px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}

.report-title {
  font-family: 'Bakbak One', sans-serif;
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 20px;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.report-options {
  display: grid;
  gap: 14px;
}

.report-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.report-team {
  cursor: pointer;
  position: relative;
}

.report-team input {
  display: none;
}

.team-card {
  border-radius: 14px;
  padding: 18px;
  font-family: 'Bakbak One', sans-serif;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: .3px;
  text-align: center;
  transition: all .2s ease;
  border: 2px solid transparent;
  text-transform: uppercase;
}

.team-card.team-a {
  background: linear-gradient(135deg, #193C6D, #002135);
  color: #fff;
}

.team-card.team-b {
  background: linear-gradient(135deg, #1E5A9A, #8a1b1a);
  color: #fff;
}

.team-card:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.report-team:has(input:checked) .team-card {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,.6);
  transform: translateY(-3px);
}

.report-team:has(input:checked)::after {
  content: "✔";
  position: absolute;
  right: 18px;
  top: 18px;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
}

.team-pill {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
}

.btn-report {
  width: 100%;
  background: linear-gradient(135deg, #1E5A9A, #c93a39);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-family: 'Bakbak One', sans-serif;
  font-weight: 400;
  letter-spacing: .6px;
  text-transform: uppercase;
  box-shadow: 0 12px 40px rgba(173,34,33,.4);
  transition: all .2s ease;
  cursor: pointer;
  margin-top: 15px;
}

.btn-report:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 50px rgba(173,34,33,.6);
}

.report-status {
  padding: 14px;
  border-radius: 12px;
  font-weight: 600;
}

.report-status.pending {
  background: rgba(173,34,33,0.15);
  color: #1E5A9A;
}

.report-status.confirmed {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
}

/* =========================
   WAGERS ESPECÍFICO
========================= */
.wager-amount {
  font-family: 'Bakbak One', sans-serif;
  font-size: 2rem;
  color: #1E5A9A;
  text-align: center;
}

.wager-coin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #1E5A9A;
}

.wager-coin::before {
  content: "🪙";
}

.wager-badge {
  background: linear-gradient(135deg, #1E5A9A, #8a1b1a);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.coin-balance {
  background: #002135;
  border: 1px solid rgba(173,34,33,0.3);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.coin-balance-value {
  font-family: 'Bakbak One', sans-serif;
  font-size: 2.5rem;
  color: #1E5A9A;
}

.coin-balance-label {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
