:root {
  color-scheme: dark;
  --ink: #ece7dd;
  --muted: #a9b2b8;
  --line: #343b40;
  --panel: #161b1f;
  --paper: #101316;
  --header: #090b0d;
  --used: #17492a;
  --unused: #5a4715;
  --dragonflight: #183850;
  --tww: #50311e;
  --midnight: #342c55;
  --finale: #552b2a;
  --focus: #66d2df;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(21, 26, 30, 0.95) 0%, rgba(10, 12, 14, 0.98) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 84px);
  color: var(--ink);
  font-family: "Aptos", "Segoe UI", sans-serif;
}

.masthead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(16px, 4vw, 44px) 22px;
  background: var(--header);
  color: #fff;
  border-bottom: 4px solid #8a6f4d;
}

.eyebrow {
  margin: 0 0 4px;
  color: #b9c9c1;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 700;
  line-height: 0.95;
}

.summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.summary span {
  min-width: 96px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.summary strong {
  display: block;
  font-size: 1.45rem;
}

main {
  padding: 18px clamp(12px, 3vw, 36px) 36px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) repeat(4, minmax(140px, 0.7fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select,
button {
  min-height: 40px;
  border: 1px solid var(--line);
  background: #101418;
  color: var(--ink);
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 0 10px;
}

button {
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid rgba(102, 210, 223, 0.25);
  border-color: var(--focus);
}

.table-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(38, 45, 49, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
}

.table-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

.table-wrap {
  max-height: calc(100vh - 235px);
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

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

th:last-child,
td:last-child {
  border-right: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #3d454a;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

tbody tr:nth-child(even) td {
  background: #12181c;
}

td.log-name {
  min-width: 360px;
  max-width: 850px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 700;
  white-space: nowrap;
}

.chip.used {
  background: var(--used);
}

.chip.unused {
  background: var(--unused);
}

.chip.dragonflight {
  background: var(--dragonflight);
}

.chip.the-war-within {
  background: var(--tww);
}

.chip.midnight {
  background: var(--midnight);
}

.chip.finale {
  background: var(--finale);
}

.empty {
  padding: 44px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .masthead {
    display: block;
  }

  .summary {
    justify-content: flex-start;
    margin-top: 18px;
  }

  .controls {
    grid-template-columns: 1fr 1fr;
  }

  .search {
    grid-column: 1 / -1;
  }
}

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

  .table-wrap {
    max-height: calc(100vh - 310px);
  }

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