:root {
  color-scheme: light dark;
  --surface-1: #fcfcfb;
  --surface-2: #f0efec;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #86847e;
  --grid: #e3e2dd;
  --accent: #2a78d6;
  --card-border: #e6e5e0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface-1: #1a1a19;
    --surface-2: #232322;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #8a887f;
    --grid: #33322f;
    --accent: #3987e5;
    --card-border: #2e2d2a;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--surface-1);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
.app { max-width: 1200px; margin: 0 auto; padding: 32px; }
h1 { font-size: 22px; margin: 0 0 4px; }
.subtitle { color: var(--text-secondary); font-size: 13px; margin: 0 0 24px; }

.filters {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end;
  background: var(--surface-2); border: 1px solid var(--card-border);
  border-radius: 10px; padding: 16px 20px; margin-bottom: 16px;
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field-grow { flex: 1; min-width: 200px; }
.field-check { flex-direction: row; align-items: center; }
.field label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.field select, .field input[type="text"] {
  padding: 7px 10px; border-radius: 6px; border: 1px solid var(--card-border);
  background: var(--surface-1); color: var(--text-primary); font-size: 13px;
}

.result-info { font-size: 12px; color: var(--text-secondary); margin: 4px 0 12px; }

.dungeon-section {
  background: var(--surface-2); border: 1px solid var(--card-border);
  border-radius: 10px; padding: 16px 20px; margin-bottom: 20px;
}
.dungeon-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.dungeon-header h2 { font-size: 16px; margin: 0; }
.tabs { display: flex; gap: 4px; }
.tab {
  font-size: 12px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--card-border);
  background: var(--surface-1); color: var(--text-secondary); cursor: pointer;
}
.tab:hover { color: var(--text-primary); }
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--text-muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--text-primary); }
thead th.sort-active { color: var(--accent); }
tbody td {
  padding: 7px 10px; border-bottom: 1px solid var(--grid);
  font-variant-numeric: tabular-nums;
}
tbody tr:nth-child(even) { background: var(--surface-2); }
.player { color: var(--text-primary); }
.player.match { color: var(--accent); font-weight: 600; }
.unresolved { color: var(--text-muted); font-style: italic; }
