:root {
  --bg: #0b0f17;
  --panel: #131926;
  --line: #1f2937;
  --text: #e8ecf3;
  --muted: #7d8797;
  /* The stat line is the whole reason a card exists, so it is read at the
     same brightness as the player's name rather than dimmed like a caption.
     The units beside the figures stay grey, which is what keeps the row from
     turning into a wall of white. */
  --stat: #f2f5fa;
  --accent: #ff6b1a;
  --gold: #f5c451;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 80px;
  -webkit-font-smoothing: antialiased;
}

h1 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 32px;
}

#status {
  color: var(--muted);
}

/* The way between the two pages. There is nothing else to navigate here, so
   one link in the corner is the whole of it. */
#top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Drawn as a button rather than a word. A grey link beside a grey heading is
   invisible, and this is the only way to the other half of the project. */
.switch {
  display: inline-block;
  margin-left: 16px;
  padding: 7px 13px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: 2px;
  transition: border-color 0.12s ease, color 0.12s ease;
}

.switch:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* --- the two pickers --- */

#pickers {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}

.picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.vs {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-top: 4px;
}

/* --- the dropdown we draw ourselves --- */

.combo {
  position: relative;
}

.combo-field {
  font: inherit;
  font-size: 0.95rem;
  width: 100%;
  /* Browsers give <input> and <button> different box-sizing by default, so
     without this the name box is 48px wider than the season box under it. */
  box-sizing: border-box;
  padding: 10px 34px 10px 12px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  appearance: none;
  text-align: left;
  cursor: pointer;
}

input.combo-field {
  cursor: text;
}

.combo-field::placeholder,
.combo-field.is-empty {
  color: var(--muted);
}

.combo-field:focus {
  outline: none;
  border-color: var(--accent);
}

.combo.is-disabled .combo-field {
  opacity: 0.4;
  cursor: not-allowed;
}

/* The chevron, drawn with two borders rotated 45 degrees. */
.combo::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 17px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
  transition: transform 0.12s ease;
}

.combo.is-open::after {
  transform: rotate(-135deg);
  border-color: var(--accent);
}

.combo.is-disabled::after {
  opacity: 0.4;
}

.combo-list {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  padding: 5px;
  background: #1a2130;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.combo-option {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.combo-option.is-active {
  background: var(--accent);
  color: #12141a;
  font-weight: 600;
}

.combo-option.is-chosen:not(.is-active) {
  color: var(--accent);
}

.combo-list::-webkit-scrollbar {
  width: 9px;
}

.combo-list::-webkit-scrollbar-thumb {
  background: #2c3547;
  border-radius: 6px;
}

/* --- faces --- */

/* Shared by both pages, sized by whoever uses it. The dark plate underneath
   is what a photo fades into while it loads, and what a missing one sits on. */
.photo {
  display: block;
  margin: 0 auto;
  object-fit: cover;
  background-color: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* No photo exists for this man. The silhouette is drawn inline rather than
   kept as a file, so nothing extra has to be fetched to say "nobody knows
   what he looked like". */
.photo.is-blank {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 180'%3E%3Ccircle cx='60' cy='66' r='28' fill='%232b3040'/%3E%3Cpath d='M14 180c0-28 21-49 46-49s46 21 46 49z' fill='%232b3040'/%3E%3C/svg%3E");
  background-size: cover;
}

/* --- the comparison --- */

.compare-photo {
  width: 80px;
  height: 120px;
  margin-bottom: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

thead th {
  padding: 0 12px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.season {
  display: block;
  margin-top: 5px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
}

thead th.stat-name {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 600;
}

td {
  padding: 11px 12px;
  text-align: center;
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(31, 41, 55, 0.55);
}

/* The middle column names the stat, so it stays quiet. */
.stat-name {
  width: 36%;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

td.better {
  color: var(--accent);
  font-weight: 700;
}

/* The score is the answer to the question the page asks, so it gets to be
   three times the size of everything else. */
.rating-row td {
  border-top: 1px solid var(--line);
  border-bottom: none;
  padding-top: 22px;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.rating-row td.stat-name {
  font-size: 0.7rem;
  font-weight: 600;
  vertical-align: middle;
}

.won {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(245, 196, 81, 0.14);
  color: var(--gold);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 2px;
}

/* --- what a word means, on hover --- */

.explained {
  position: relative;
  border-bottom: 1px dotted var(--muted);
  cursor: help;
}

.explains {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  z-index: 20;
  width: 280px;
  padding: 12px 14px;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.55;
  text-transform: none;
  text-align: left;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  pointer-events: none;
}

.explained:hover .explains {
  opacity: 1;
  visibility: visible;
}

/* --- the small print --- */

#note {
  margin-top: 28px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--muted);
  padding-left: 12px;
  border-left: 2px solid var(--line);
}
