:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-subtle: #1f6feb33;
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 2rem 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.updated {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--accent-subtle); }

.rank { font-weight: 700; color: var(--text-muted); width: 3rem; text-align: center; }
.team { font-weight: 600; }
.team a { color: var(--accent); text-decoration: none; cursor: pointer; }
.team a:hover { text-decoration: underline; }
.score-total { font-weight: 700; font-size: 1.1rem; }
.score-sub { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.count { text-align: center; }

/* Score bar */
.score-bar {
  display: inline-block;
  width: 60px;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 0.5rem;
}
.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
}

/* Detail panel (expandable) */
.detail-row td {
  padding: 0;
  background: var(--bg);
}
.detail-panel {
  padding: 1rem 1.5rem;
  font-size: 0.85rem;
}
.detail-panel h3 {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}
.check-list { list-style: none; margin-bottom: 1rem; }
.check-list li { padding: 0.2rem 0; }
.status-pass { color: var(--green); }
.status-warn { color: var(--yellow); }
.status-fail { color: var(--red); }
.issue-list { list-style: disc; margin-left: 1.5rem; color: var(--text-muted); }

/* Alignment viewer */
.alignment { margin-top: 1rem; }
.alignment h3 { font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--text-muted); }
.aln-legend {
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.aln-block {
  font-family: "SF Mono", "Menlo", "Monaco", "Consolas", monospace;
  font-size: 0.7rem;
  line-height: 1.35;
  overflow-x: auto;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.aln-label { color: var(--text-muted); }
.aa-hydrophobic { color: #6cb4ee; }
.aa-positive { color: #f47067; }
.aa-negative { color: #d2a8ff; }
.aa-polar { color: #7ee787; }
.aa-cysteine { color: #e3b341; }
.aa-glycine { color: #56d4dd; }
.aa-proline { color: #f0b72f; font-weight: 700; }
.aa-aromatic { color: #79dafa; font-weight: 700; }
.aa-triad { color: #fff; background: #da3633; border-radius: 2px; padding: 0 1px; font-weight: 700; }

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

.how-to-submit {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}
.how-to-submit h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}
.how-to-submit ol {
  margin-left: 1.25rem;
  margin-bottom: 1rem;
}
.how-to-submit li {
  padding: 0.2rem 0;
}
.how-to-submit p {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.how-to-submit a {
  color: var(--accent);
  text-decoration: none;
}
.how-to-submit a:hover {
  text-decoration: underline;
}
.how-to-submit code {
  background: var(--bg);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.85em;
}
.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  font-size: 0.85em;
  margin: 0.5rem 0 1rem;
}
.code-block code {
  background: none;
  padding: 0;
}

@media (max-width: 768px) {
  body { padding: 1rem 0.5rem; }
  thead th, tbody td { padding: 0.4rem 0.5rem; font-size: 0.8rem; }
  .score-bar { width: 40px; }
  .hide-mobile { display: none; }
}
