/* ============================================================================
 * assets/css/history.css — Contest history page (DL-S-014)
 * Uses shared theme tokens; mirrors account.css rank-pill language.
 * ========================================================================== */

.wrap { max-width: var(--wrap, 1200px); margin: 0 auto; padding: 0 24px 80px; }

/* header */
.hist-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; padding: 34px 0 22px; flex-wrap: wrap;
}
.hist-title {
  font-family: var(--disp); font-weight: 700; font-size: 34px;
  letter-spacing: -.01em; color: var(--text); line-height: 1;
}
.hist-sub { font-family: var(--sans); font-size: 14px; color: var(--muted); margin-top: 8px; }
.hist-back {
  font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--blue-bright);
  text-decoration: none; padding: 8px 4px;
}
.hist-back:hover { color: var(--blue-soft); }

/* summary stats */
.hist-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px;
}
.hstat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
}
.hstat-k {
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted-2);
}
.hstat-v {
  font-family: var(--disp); font-size: 26px; font-weight: 700; color: var(--text); margin-top: 8px;
}
.hstat-v.pos { color: var(--green); }
.hstat-v.neg { color: var(--red); }

/* controls */
.hist-controls {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.ctl-search { flex: 1 1 240px; min-width: 200px; }
.ctl-search input {
  width: 100%; box-sizing: border-box;
  font-family: var(--sans); font-size: 14px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 11px 14px; outline: none; transition: border-color var(--t, .15s);
}
.ctl-search input::placeholder { color: var(--muted-2); }
.ctl-search input:focus { border-color: var(--blue); }

.ctl-filters, .ctl-result { display: flex; gap: 6px; flex-wrap: wrap; }
.fmt-chip, .res-chip {
  font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 99px;
  padding: 8px 15px; cursor: pointer; transition: all var(--t, .15s);
}
.fmt-chip:hover, .res-chip:hover { border-color: var(--line-2); color: var(--text); }
.fmt-chip.active { background: rgba(30,144,255,.14); border-color: var(--blue); color: var(--blue-bright); }
.res-chip.active { background: rgba(255,194,71,.13); border-color: var(--gold); color: var(--gold); }

/* table */
.hist-table-wrap {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.hist-table { width: 100%; border-collapse: collapse; }
.hist-table thead th {
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted-2); text-align: left;
  padding: 14px 18px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.hist-table th.num, .hist-table td.num { text-align: right; }
.hist-table th.sortable { cursor: pointer; user-select: none; }
.hist-table th.sortable:hover { color: var(--text); }
.hist-table th.sort-asc::after { content: " \2191"; color: var(--blue-bright); }
.hist-table th.sort-desc::after { content: " \2193"; color: var(--blue-bright); }
.hist-table tbody td {
  font-family: var(--sans); font-size: 14px; color: var(--text);
  padding: 13px 18px; border-bottom: 1px solid var(--line);
}
.hist-table tbody tr:last-child td { border-bottom: none; }
.hist-table tbody tr:hover { background: var(--panel-2); }
.hist-table td.muted { color: var(--muted); font-size: 13px; }
.hist-table td.num { font-family: 'Chivo Mono', monospace; font-variant-numeric: tabular-nums; }
.hist-table td.pos { color: var(--green); }
.hist-table td.neg { color: var(--red); }
.hist-table td.vch { color: var(--voucher); font-weight: 600; }

/* rank pill — mirrors account.css */
.rank-pill {
  display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px;
  border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--muted);
}
.rank-pill.win { background: rgba(255,194,71,.14); border-color: rgba(255,194,71,.5); color: var(--gold); }
.rank-pill.paid { background: rgba(255,194,71,.14); border-color: rgba(255,194,71,.5); color: var(--voucher); }
.rank-pill.dq { background: rgba(255,77,94,.12); border-color: rgba(255,77,94,.5); color: var(--red); }

/* empty state */
.hist-empty { padding: 48px 24px; text-align: center; }
.hist-empty p { font-family: var(--sans); font-size: 15px; color: var(--muted); margin-bottom: 14px; }
.empty-cta { font-family: var(--sans); font-weight: 600; color: var(--blue-bright); text-decoration: none; }
.empty-cta:hover { color: var(--blue-soft); }

/* responsive */
@media (max-width: 720px) {
  .hist-stats { grid-template-columns: repeat(2, 1fr); }
  .hist-title { font-size: 27px; }
  .hist-table thead th:nth-child(1), .hist-table tbody td:nth-child(1) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ctl-search input, .fmt-chip, .res-chip { transition: none; }
}
