/* =========================
   inMatch.css — Tema consistente con standings.css
   ========================= */

/* === Variables === */
:root {
  --bg:#0b1220;
  --card:#111a2b;
  --text:#f5f7fb;
  --muted:#a8b3cf;
  --accent:#22c55e;
  --border:#1f2a44;
  --accent-blue:#3d5afe;
}

/* === Reset base === */
* { box-sizing: border-box; }
html, body { margin:0; padding:0; width:100%; height:100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;
}

/* =========================
   MODAL
   ========================= */
.modal-overlay {
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,.6);
  z-index: 1000;
}
.modal-overlay.active { display: flex; }

.modal-content {
  width: 92%; max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.modal-content h2, .modal-content h3 { margin: 0 0 12px; font-weight: 700; }
.modal-content p { color: var(--muted); margin: 0 0 12px; }

.modal-content select,
.modal-content button {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  background: #0f1a30;
  color: var(--text);
  margin-top: 10px;
}
.modal-content button {
  background: var(--accent-blue);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
}
.modal-content button:hover { background: #4f6bff; }

/* =========================
   HEADER MARCADOR
   ========================= */
.match-header {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 14px 14px 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}

.team-logo { display:flex; align-items:center; gap:.5rem; }
.team-logo img {
  width: 40px; height: 40px; object-fit: cover;
  border: 1px solid var(--border); border-radius: 8px;
}
.team-logo span { font-weight:700; font-size:1.05rem; }

.match-score {
  display:flex; flex-direction:column; align-items:center; gap:2px;
}
#scoreDisplay { font-size: 2.2rem; font-weight: 800; color: var(--accent); }
#matchTime { font-size: .95rem; color: var(--muted); }
#matchStatus { font-size: .8rem; color: var(--accent-blue); text-transform: uppercase; }

/* =========================
   PESTAÑAS (Tabs)
   ========================= */
.tabs {
  display:flex; align-items:center; gap:6px;
  padding: 8px 10px;
  margin: 0 14px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.tab {
  appearance:none; border:none; background: transparent;
  padding:10px 12px; border-radius:10px;
  color: var(--muted); font-weight:600; cursor:pointer;
  transition: all .15s ease;
}
.tab:hover { background:#0f1a30; color:var(--text); }
.tab.active {
  background: #0f1a30;
  color: var(--text);
  border: 1px solid var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(61,90,254,.15) inset;
}

/* Enlace “Tabla global” */
.standings-link {
  margin-left: auto;
  text-decoration: none;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  color: var(--text);
  font-weight:700;
}
.standings-link:hover { background:#0f1a30; }

/* =========================
   CONTENIDO DE PESTAÑAS
   ========================= */
.tab-content { display:none; padding: 0 14px 14px; }
.tab-content.active { display:block; }

/* =========================
   RESUMEN (Chat de eventos)
   ========================= */
#summary h2 { margin: 6px 0 10px; padding-left: 2px; }

.actions-comments-container { display:flex; flex-direction:column; gap:8px; }

.chat-bubble {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex; align-items: center; gap: 10px;
}
.comment-left { justify-content:flex-start; }
.comment-right { justify-content:flex-end; }
.comment-center { justify-content:center; }

.bubble-header { display:flex; align-items:center; gap:8px; width:100%; }
.bubble-player-img {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--border); object-fit: cover;
}
.bubble-player { font-weight:700; }
.bubble-text { color: var(--text); }
.bubble-time { margin-left:auto; color:var(--muted); font-size:.85rem; }

.load-more-btn {
  position: fixed; bottom: 18px; left: 18px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
  cursor: pointer; font-weight:700;
}
.load-more-btn:hover { background:#0f1a30; }

/* =========================
   ALINEACIONES
   ========================= */
#lineup .lineup-section {
  display:flex; gap:12px; flex-wrap:wrap;
}
.lineup-card {
  flex:1 1 340px;
  background: var(--card);
  border:1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.22);
}
#lineup h2 { margin: 10px 0; }
#lineup h3 { margin: 12px 0 8px; font-size:1rem; color: var(--text); }

.reload-btn {
  display:block; margin: 8px auto 12px;
  background: var(--accent-blue); color:#fff;
  border:none; border-radius:10px;
  padding:8px 14px; font-weight:700; cursor:pointer;
}
.reload-btn:hover { background:#4f6bff; }

.players-list { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; }

.player-card {
  width: 126px;
  background: linear-gradient(145deg, #f0d9b5, #d6b375);
  color:#000;
  border-radius: 12px;
  padding: 8px 6px;
  text-align:center;
  box-shadow: 0 4px 10px rgba(0,0,0,.25);
  border:2px solid transparent;
}
.player-card .player-name { font-weight:700; font-size: 14px; }
.player-card .player-position { font-size: 12px; opacity:.85; }
.player-card .player-number { font-size: 12px; color:#222; }

/* =========================
   ESTADÍSTICAS
   ========================= */
#stats h2 { margin: 8px 0 12px; }

.positions-section,
.top-player,
.stats-average { margin-bottom: 16px; }

.positions-table,
.stats-table {
  width:100%; border-collapse:collapse;
  background: var(--card);
  border:1px solid var(--border);
  border-radius: 12px;
  overflow:hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,.22);
}
.positions-table thead th,
.stats-table thead th {
  background:#0f1a30;
  color: var(--muted);
  text-align:left;
  padding:10px;
  position: sticky; top: 0;
}
.positions-table tbody td,
.stats-table tbody td {
  padding:10px; border-top:1px solid var(--border);
}
.positions-table tbody tr:hover,
.stats-table tbody tr:hover { background: rgba(255,255,255,.04); }

#positionsBody tr.highlight { background: rgba(255,235,59,.18); font-weight:700; }

.stats-tabs {
  display:flex; gap:6px; margin: 12px 0;
}
.stats-tab {
  flex:1; text-align:center;
  background: var(--card);
  border:1px solid var(--border);
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer; font-weight:700;
}
.stats-tab:hover { background:#0f1a30; color:var(--text); }
.stats-tab.active {
  color: var(--text);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(61,90,254,.15) inset;
}
.stats-table.hidden { display:none; }

.top-player .player-card {
  background: var(--card);
  color: var(--text);
  border:1px solid var(--border);
  border-radius:12px;
  padding: 10px 12px;
}
.top-player .player-score { margin-top: 6px; color: var(--muted); }

.stats-average {
  background: var(--card);
  border:1px solid var(--border);
  border-radius:12px;
  padding: 10px 12px;
}
.stats-average h4 { margin: 0 0 6px; }
.stats-average p { color: var(--muted); }

/* =========================
   BOTONES FLOTANTES
   ========================= */
.change-match-btn {
  position: fixed; bottom: 18px; right: 18px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 14px; border-radius: 10px;
  display:flex; align-items:center; gap:6px;
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
  cursor: pointer; z-index: 1100; font-weight:700;
}
.change-match-btn:hover { background:#0f1a30; }
.change-match-btn svg { width: 16px; height: 16px; }

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 700px) {
  .team-logo span { font-size: 0.95rem; }
  #scoreDisplay { font-size: 2rem; }
  .tabs { flex-wrap: wrap; gap: 8px; }
  .standings-link { margin-left: 0; }
}
