/* ============================================================
   CONFIGURAÇÕES GERAIS
   ============================================================ */

* {
  box-sizing: border-box;
}

:root {

  --bg: #1a1a1a;

  --surface: #2e2e2e;

  --surface-2: #252525;

  --surface-3: #202020;

  --text: #e0e0e0;

  --muted: #9a9a9a;

  --line: #3b3b3b;

  --accent: #d4af37;

  --accent-soft: #444;

  --positive: #7bc47f;

  --negative: #e57373;

  --shadow: rgba(0, 0, 0, 0.35);
}


/* ============================================================
   BODY
   ============================================================ */

body {

  margin: 0;

  font-family:
    'Noto Sans',
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background: var(--bg);

  color: var(--text);

  line-height: 1.45;
}


/* ============================================================
   CONTAINER
   ============================================================ */

.container {

  width: min(1180px, calc(100% - 32px));

  margin: 0 auto;
}


/* ============================================================
   HERO
   ============================================================ */

.hero {

  background: var(--bg);

  color: var(--accent);

  padding: 56px 0 42px;

  border-bottom: 1px solid var(--line);
}


.eyebrow {

  margin: 0 0 8px;

  font-size: .78rem;

  letter-spacing: .14em;

  color: var(--muted);
}


h1 {

  margin: 0;

  font-size: clamp(2.3rem, 6vw, 4rem);

  line-height: 1;

  font-weight: 800;

  color: var(--accent);
}


.subtitle {

  max-width: 760px;

  margin: 18px 0 0;

  font-size: 1.05rem;

  color: var(--muted);
}


.status {

  margin-top: 20px;

  font-size: .9rem;

  color: var(--muted);
}


.interval {

  margin-top: 5px;

  font-size: .82rem;

  color: #777;
}


/* ============================================================
   MAIN
   ============================================================ */

main {

  padding: 28px 0 50px;
}


/* ============================================================
   CARDS PRINCIPAIS
   ============================================================ */

.cards {

  display: grid;

  grid-template-columns:
    repeat(4, 1fr);

  gap: 14px;

  margin-bottom: 18px;
}


.card {

  background: var(--surface);

  border: 1px solid var(--line);

  border-radius: 14px;

  padding: 20px;

  min-height: 105px;
}


.card-label {

  color: var(--muted);

  font-size: .82rem;
}


.card-value {

  display: block;

  margin-top: 7px;

  font-size: 1.75rem;

  line-height: 1.15;

  font-weight: 800;

  color: var(--accent);
}


/* ============================================================
   PAINÉIS
   ============================================================ */

.panel {

  background: var(--surface);

  border: 1px solid var(--line);

  border-radius: 14px;

  margin-bottom: 18px;

  overflow: hidden;
}


.panel-head {

  padding: 20px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 16px;

  border-bottom: 1px solid var(--line);
}


h2 {

  margin: 0;

  font-size: 1.15rem;

  color: var(--accent);
}


.panel-head p {

  margin: 5px 0 0;

  color: var(--muted);

  font-size: .86rem;
}


/* ============================================================
   INPUT / SELECT
   ============================================================ */

input,
select {

  width: min(320px, 100%);

  border: 1px solid var(--line);

  border-radius: 9px;

  padding: 10px 12px;

  font: inherit;

  background: var(--bg);

  color: var(--text);

  outline: none;
}


input::placeholder {

  color: #777;
}


input:focus,
select:focus {

  border-color: var(--accent);

  box-shadow:
    0 0 0 2px rgba(212, 175, 55, .12);
}


select {

  cursor: pointer;

  min-width: 300px;
}


/* ============================================================
   TABELAS & AVATARES DE JOGADORES
   ============================================================ */

.table-wrap {

  max-height: 500px;

  overflow-y: auto;

  overflow-x: auto;
}


table {

  width: 100%;

  border-collapse: collapse;

  min-width: 760px;

  background: var(--surface);
}


th,
td {

  padding: 11px 14px;

  border-bottom: 1px solid var(--line);

  text-align: left;

  font-size: .9rem;

  white-space: nowrap;
}


th {

  color: var(--muted);

  font-weight: 650;

  background: var(--surface);

  position: sticky;

  top: 0;

  z-index: 2;
}


tbody tr:last-child td {

  border-bottom: 0;
}


tbody tr {

  transition:
    background .12s ease;
}


#ranking tbody tr:nth-child(odd) {
  background: var(--surface);
}

#ranking tbody tr:nth-child(even) {
  background: var(--surface-2);
}


#ranking tbody tr:hover {

  background: var(--accent-soft) !important;

  cursor: pointer;
}


.rank {

  color: var(--muted);

  width: 45px;
}


.col-position {

  width: 45px;
}


.player {

  font-weight: 700;

  color: var(--text);
}

/* Célula de Jogador com Foto */
.player-cell {

  display: inline-flex;

  align-items: center;

  gap: 10px;
}

.player-avatar {

  width: 32px;

  height: 32px;

  border-radius: 50%;

  object-fit: cover;

  border: 1px solid var(--line);

  cursor: pointer;

  transition: transform 0.15s ease, border-color 0.15s ease;
}

.player-avatar:hover {

  transform: scale(1.15);

  border-color: var(--accent);
}

.player-avatar-large {

  width: 56px;

  height: 56px;

  border-radius: 50%;

  object-fit: cover;

  border: 2px solid var(--accent);

  cursor: pointer;

  transition: transform 0.2s ease;
}

.player-avatar-large:hover {

  transform: scale(1.08);
}


/* ============================================================
   MOVIMENTO DO RANKING
   ============================================================ */

.movement {

  font-weight: 800;

  text-align: center;

  min-width: 70px;
}


.movement.up {

  color: var(--positive);
}


.movement.down {

  color: var(--negative);
}


.movement.same {

  color: var(--muted);
}


.movement.new {

  color: var(--accent);

  font-size: .76rem;

  letter-spacing: .03em;
}


/* ============================================================
   CORES DA CLASSIFICAÇÃO
   ============================================================ */

/* Pontuação */
#ranking .points-cell {
  color: #7bc47f;
}

#ranking .points-cell strong {
  color: inherit;
  font-weight: 700;
}


/* Primeiro lugar — dourado */
#ranking .podium-first {
  color: #d4af37;
  font-weight: 700;
}


/* Segundo lugar — prata */
#ranking .podium-second {
  color: #c0c0c0;
  font-weight: 700;
}


/* Terceiro lugar — bronze */
#ranking .podium-third {
  color: #cd7f32;
  font-weight: 700;
}


/* ============================================================
   LINKS
   ============================================================ */

a {

  color: var(--accent);

  font-weight: 650;

  text-decoration: none;
}


a:hover {

  text-decoration: underline;
}


/* ============================================================
   GRID
   ============================================================ */

.grid {

  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 18px;
}


/* ============================================================
   DESEMPENHO DO JOGADOR
   ============================================================ */

.performance-panel {

  overflow: hidden;
}


.performance-header {

  align-items: center;
}


.player-performance {

  padding: 24px;
}


.player-heading {

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 20px;

  margin-bottom: 20px;
}


.player-label {

  display: block;

  color: var(--muted);

  font-size: .78rem;

  text-transform: uppercase;

  letter-spacing: .08em;

  margin-bottom: 4px;
}


.player-heading h3 {

  margin: 0;

  font-size: 1.65rem;

  color: var(--text);
}


.current-position {

  display: flex;

  align-items: center;

  justify-content: center;

  min-width: 80px;

  padding: 10px 16px;

  border-radius: 10px;

  background: var(--bg);

  border: 1px solid var(--line);

  color: var(--accent);

  font-weight: 800;

  font-size: 1.1rem;
}


/* ============================================================
   MINI CARDS
   ============================================================ */

.player-cards {

  display: grid;

  grid-template-columns:
    repeat(4, 1fr);

  gap: 12px;

  margin-bottom: 24px;
}


.mini-card {

  padding: 16px;

  border-radius: 10px;

  background: var(--surface-2);

  border: 1px solid var(--line);
}


.mini-card span {

  display: block;

  color: var(--muted);

  font-size: .78rem;

  margin-bottom: 6px;
}


.mini-card strong {

  color: var(--accent);

  font-size: 1.35rem;
}


/* ============================================================
   GRÁFICOS
   ============================================================ */

.charts-grid {

  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 18px;

  margin-bottom: 26px;
}


.chart-card {

  background: var(--surface-2);

  border: 1px solid var(--line);

  border-radius: 12px;

  padding: 18px;
}


.chart-title h3 {

  margin: 0;

  font-size: 1rem;

  color: var(--text);
}


.chart-title p {

  margin: 4px 0 15px;

  color: var(--muted);

  font-size: .8rem;
}


.chart-container {

  position: relative;

  height: 300px;
}


/* ============================================================
   HISTÓRICO
   ============================================================ */

.participations-section {

  border-top: 1px solid var(--line);

  padding-top: 22px;
}


.section-title {

  margin-bottom: 14px;
}


.section-title h3 {

  margin: 0;

  font-size: 1rem;

  color: var(--text);
}


.section-title p {

  margin: 4px 0 0;

  color: var(--muted);

  font-size: .82rem;
}


#participations-table {

  min-width: 850px;
}


/* ============================================================
   ESTADO VAZIO
   ============================================================ */

.player-empty {

  padding: 45px 25px;

  text-align: center;

  color: var(--muted);
}


.player-empty h3 {

  margin: 8px 0 5px;

  color: var(--text);

  font-size: 1.05rem;
}


.player-empty p {

  max-width: 520px;

  margin: 0 auto;

  font-size: .85rem;
}


.empty-icon {

  font-size: 2rem;

  color: var(--accent);

  opacity: .8;
}


.hidden {

  display: none !important;
}


/* ============================================================
   MODAL DE ZOOM DO AVATAR
   ============================================================ */

.modal {

  position: fixed;

  top: 0;

  left: 0;

  width: 100vw;

  height: 100vh;

  background: rgba(0, 0, 0, 0.85);

  backdrop-filter: blur(4px);

  display: flex;

  align-items: center;

  justify-content: center;

  z-index: 9999;
}

.modal-content {

  position: relative;

  background: var(--surface);

  padding: 20px;

  border-radius: 16px;

  border: 1px solid var(--line);

  box-shadow: 0 10px 30px var(--shadow);

  text-align: center;

  max-width: 90vw;

  max-height: 90vh;
}

.modal-content img {

  max-width: 320px;

  max-height: 320px;

  width: 100%;

  height: auto;

  border-radius: 50%;

  object-fit: cover;

  border: 3px solid var(--accent);
}

.modal-content p {

  margin: 15px 0 0;

  font-weight: 700;

  font-size: 1.2rem;

  color: var(--text);
}

.modal-close {

  position: absolute;

  top: 10px;

  right: 16px;

  font-size: 1.8rem;

  color: var(--muted);

  cursor: pointer;

  line-height: 1;

  transition: color 0.15s ease;
}

.modal-close:hover {

  color: var(--accent);
}


/* ============================================================
   FOOTER
   ============================================================ */

footer {

  padding: 25px 0 40px;

  color: var(--muted);

  font-size: .82rem;

  border-top: 1px solid var(--line);
}


footer .container {

  display: flex;

  justify-content: space-between;

  gap: 15px;
}


/* ============================================================
   SCROLLBAR
   ============================================================ */

.table-wrap::-webkit-scrollbar {

  width: 10px;

  height: 10px;
}


.table-wrap::-webkit-scrollbar-track {

  background: var(--surface-3);
}


.table-wrap::-webkit-scrollbar-thumb {

  background: #555;

  border-radius: 8px;
}


.table-wrap::-webkit-scrollbar-thumb:hover {

  background: #666;
}


/* ============================================================
   RESPONSIVIDADE
   ============================================================ */

@media (max-width: 1000px) {

  .cards {

    grid-template-columns:
      repeat(2, 1fr);
  }


  .player-cards {

    grid-template-columns:
      repeat(2, 1fr);
  }


  .charts-grid {

    grid-template-columns:
      1fr;
  }

}


@media (max-width: 760px) {

  .grid {

    grid-template-columns:
      1fr;
  }


  .panel-head {

    align-items: flex-start;

    flex-direction: column;
  }


  .performance-header {

    align-items: stretch;
  }


  .performance-header select {

    width: 100%;

    min-width: 0;
  }


  .player-heading {

    align-items: flex-start;

    flex-direction: column;
  }


  .current-position {

    align-self: flex-start;
  }

}


@media (max-width: 560px) {

  .container {

    width: min(100% - 20px, 1180px);
  }


  .hero {

    padding: 40px 0 32px;
  }


  .cards {

    grid-template-columns:
      1fr;
  }


  .player-cards {

    grid-template-columns:
      1fr 1fr;
  }


  .player-performance {

    padding: 16px;
  }


  .chart-container {

    height: 260px;
  }


  footer .container {

    flex-direction: column;
  }

}
