:root {
  --bg: #0a0c10;
  --surface: #111318;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eaf0;
  --muted: #6b7280;
  --red: #ef4444;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
.num { font-family: ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.addr { font-family: ui-monospace, Menlo, Consolas, monospace; }

header { border-bottom: 1px solid var(--border); padding: 16px; }
header .wrap { max-width: 1200px; margin: 0 auto; display: flex; align-items: baseline; gap: 12px; }
header h1 { font-size: 20px; margin: 0; font-weight: 800; letter-spacing: -0.01em; color: var(--red); }
header .sub { font-size: 12px; color: var(--muted); }

main { max-width: 1200px; margin: 0 auto; padding: 20px 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }

.layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.col-grid { position: sticky; top: 16px; }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; padding: 12px; }
.tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  outline: 1px solid var(--border);
  outline-offset: -1px;
  cursor: pointer;
  transition: opacity 0.15s, outline 0.15s, transform 0.1s;
}
.tile:hover { transform: scale(1.1); z-index: 2; outline-color: var(--red); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.dim { opacity: 0.12; }
.tile.owned { outline: 2px solid var(--red); outline-offset: 0; }
.tile .badgenum {
  position: absolute;
  bottom: 0; left: 0;
  font-size: 12px; line-height: 1.1;
  font-weight: 700;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.62);
  padding: 1px 5px;
  border-top-right-radius: 5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 600; margin: 20px 4px 8px;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; text-align: left; }
th { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
tbody tr.sel { background: rgba(239, 68, 68, 0.10); }
td.r, th.r { text-align: right; }
.dl-link {
  color: var(--red); text-transform: none; letter-spacing: normal;
  font-weight: 700; font-size: 12px; cursor: pointer; text-decoration: none;
  border: 1px solid rgba(239, 68, 68, 0.4); border-radius: 6px; padding: 3px 9px;
}
.dl-link:hover { background: rgba(239, 68, 68, 0.12); }
.count-badge {
  display: inline-block; min-width: 32px; text-align: center;
  background: rgba(239, 68, 68, 0.15); color: var(--red);
  border-radius: 7px; padding: 4px 11px; font-weight: 700; font-size: 16px;
}

footer { max-width: 1200px; margin: 0 auto; padding: 24px 16px; color: var(--muted); font-size: 11px; text-align: center; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .col-grid { position: static; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(8, 1fr); }
}
