:root {
  --bg: #f6f6f1;
  --ink: #11161a;
  --muted: #5f6b73;
  --accent: #f04a17;
  --accent-2: #0b1f2a;
  --card: #ffffff;
  --line: rgba(17, 22, 26, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -20%, rgba(255, 194, 175, 0.8) 0%, rgba(255, 194, 175, 0) 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(189, 219, 255, 0.75) 0%, rgba(189, 219, 255, 0) 55%),
    var(--bg);
  min-height: 100vh;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: 32px;
  align-items: center;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.75));
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px rgba(17, 22, 26, 0.1);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 106, 61, 0.15);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  font-family: "Anton", Impact, sans-serif;
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: 0.02em;
  margin: 12px 0 6px;
}

.subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 16px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.hero-metric {
  background: var(--accent-2);
  color: #fff;
  padding: 20px 22px;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
}

.hero-metric::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(140px 100px at 20% 0%, rgba(255, 255, 255, 0.2), transparent 70%);
  pointer-events: none;
}

.day-count {
  font-size: 28px;
  font-weight: 700;
}

.progress {
  margin: 14px 0 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff8b61, #ffd26d);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.athletes {
  margin: 28px 0 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 14px 24px rgba(17, 22, 26, 0.08);
  overflow: hidden;
}

.athletes summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.athletes summary::-webkit-details-marker { display: none; }

.athletes summary::after {
  content: "+";
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.athletes[open] summary::after {
  content: "–";
  transform: translateY(-1px);
}

.athletes-content {
  padding: 12px 16px 16px;
}

.athletes-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.athlete-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.row-disqualified {
  opacity: 0.7;
}

.tag-disqualified {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 10px;
  color: #b04a3a;
  background: rgba(176, 74, 58, 0.08);
}

.table-separator td {
  padding: 10px 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px dashed var(--line);
  border-top: 1px dashed var(--line);
}

.athlete-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 12px 20px rgba(17, 22, 26, 0.08);
  display: grid;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a.athlete-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(17, 22, 26, 0.12);
  border-color: var(--accent);
}

/* Celula do atleta na tabela */
.athlete-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: inherit;
}

.athlete-name-cell {
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.athlete-cell:hover .athlete-name-cell {
  color: var(--accent);
}

.athlete-view-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.athlete-view-link::after {
  content: "→";
  transition: transform 0.2s ease;
}

.athlete-cell:hover .athlete-view-link::after {
  transform: translateX(3px);
}

.view-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  margin-top: 8px;
  background: var(--accent);
  color: white;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.view-more svg {
  transition: transform 0.2s ease;
}

a.athlete-card:hover .view-more {
  background: #d63d0f;
}

a.athlete-card:hover .view-more svg {
  transform: translateX(3px);
}

.athlete-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(255, 122, 78, 0.9), rgba(255, 198, 109, 0.8));
  box-shadow: 0 6px 12px rgba(17, 22, 26, 0.15);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.04em;
  overflow: hidden;
}

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

.athlete-name {
  font-weight: 700;
  font-size: 16px;
}

.athlete-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(17, 22, 26, 0.04);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 12px;
}

.stat-pill strong {
  font-size: 13px;
  color: var(--ink);
}

.athlete-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.athlete-stat {
  background: rgba(17, 22, 26, 0.03);
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.athlete-stat span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.athlete-stat strong {
  font-size: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 10px 20px rgba(17, 22, 26, 0.08);
}

.card-title {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 700;
}

.card-value {
  font-size: 28px;
  font-weight: 700;
}

.card-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
}

.panel {
  background: var(--card);
  border-radius: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 30px rgba(17, 22, 26, 0.1);
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

h2 {
  font-size: 18px;
  margin: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}

th, td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.td-number {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.status-ok { color: #1f9d63; }
.status-fail { color: #ff6a5b; }
.status-neutral { color: var(--muted); }

.pill {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(17, 22, 26, 0.02);
}

.note { margin-top: 10px; }

.footnotes {
  margin: 18px 0 8px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.footnotes h3 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.footnotes p {
  margin: 0 0 8px;
}

.footnotes p:last-child { margin-bottom: 0; }

.data-note {
  margin: 18px 0 8px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  background: rgba(17, 22, 26, 0.02);
}

.data-note strong { color: var(--ink); }

.data-note .brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--accent);
}

.data-note svg {
  width: 16px;
  height: 16px;
}

.stagger {
  animation: rise 0.6s ease forwards;
  opacity: 0;
  transform: translateY(12px);
}

.cards .card:nth-child(1) { animation-delay: 0.05s; }
.cards .card:nth-child(2) { animation-delay: 0.12s; }
.cards .card:nth-child(3) { animation-delay: 0.18s; }
.athletes { animation-delay: 0.2s; }
.footnotes { animation-delay: 0.22s; }
.panel:nth-child(1) { animation-delay: 0.12s; }
.panel:nth-child(2) { animation-delay: 0.18s; }

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Table wrapper */
.table-wrapper {
  width: 100%;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .app {
    padding: 20px 16px 40px;
  }

  /* Grid de paineis em coluna */
  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Cards de resumo - 3 colunas compactas */
  .cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .card {
    padding: 12px 10px;
    text-align: center;
  }

  .card-title {
    font-size: 9px;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
  }

  .card-value {
    font-size: 22px;
  }

  .card-meta {
    font-size: 10px;
    margin-top: 4px;
  }

  /* Paineis */
  .panel {
    padding: 14px;
    border-radius: 16px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 14px;
  }

  /* Tabelas */
  table {
    font-size: 13px;
  }

  th, td {
    padding: 10px 6px;
    vertical-align: top;
  }

  th {
    font-size: 10px;
  }

  /* Celula do atleta */
  .athlete-name-cell {
    font-size: 13px;
  }

  .athlete-view-link {
    font-size: 10px;
  }

  /* Status */
  .status {
    font-size: 11px;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .status::before {
    display: none;
  }

  /* Tag desclassificado */
  .tag-disqualified {
    font-size: 8px;
    padding: 2px 4px;
    display: block;
    margin-top: 4px;
    margin-left: 0;
  }

  /* Separadores */
  .table-separator td {
    font-size: 10px;
    padding: 8px 6px;
  }

  /* Grid de atletas */
  .athlete-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .app {
    padding: 16px 12px 32px;
  }

  h1 {
    font-size: 28px;
  }

  .hero {
    padding: 18px;
    border-radius: 18px;
  }

  .hero-metric {
    padding: 16px;
  }

  .day-count {
    font-size: 22px;
  }

  /* Cards ainda mais compactos */
  .cards {
    gap: 8px;
  }

  .card {
    padding: 10px 6px;
    border-radius: 12px;
  }

  .card-title {
    font-size: 8px;
    margin-bottom: 4px;
  }

  .card-value {
    font-size: 18px;
  }

  .card-meta {
    font-size: 9px;
  }

  /* Tabelas compactas */
  table {
    font-size: 12px;
  }

  th, td {
    padding: 8px 4px;
  }

  th {
    font-size: 9px;
  }

  .athlete-name-cell {
    font-size: 12px;
  }

  .athlete-view-link {
    font-size: 9px;
  }

  .status {
    font-size: 10px;
  }

  /* View more button */
  .view-more {
    padding: 8px 12px;
    font-size: 12px;
  }
}
