:root {
  color-scheme: dark;
  --page: #0c111b;
  --panel: #131b29;
  --panel-raised: #182335;
  --line: #28374d;
  --text: #e8eef8;
  --muted: #9aaac0;
  --accent: #76c7ff;
  --green: #63d6a5;
  --amber: #f3c878;
  --red: #f18e92;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 82% 0%, #17304a 0, transparent 36rem),
    var(--page);
  color: var(--text);
  font: 15px/1.6 "Segoe UI", "Helvetica Neue", sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

header { padding: 64px 0 34px; }

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  margin: 8px 0 10px;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  letter-spacing: -.055em;
  line-height: 1.05;
}

.intro { max-width: 760px; margin: 0; color: var(--muted); font-size: 1.05rem; }

.snapshot {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #101927;
  color: var(--muted);
  font-size: .85rem;
}

.snapshot::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

main { padding-bottom: 56px; }

.notice {
  margin: 0 0 30px;
  padding: 17px 20px;
  border: 1px solid #655636;
  border-radius: 12px;
  background: #272316;
  color: #e7d8b6;
}

.notice strong { color: #ffe2a0; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 38px 0 14px;
}

h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.02em; }
.section-note { margin: 0; color: var(--muted); font-size: .9rem; }

.tier-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.tier-card {
  min-height: 128px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, var(--panel-raised), var(--panel));
}

.tier-top { display: flex; align-items: center; gap: 10px; }
.tier-letter, .badge {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 8px;
  font-weight: 800;
}

.tier-letter { width: 32px; height: 32px; font-size: 1rem; }
.tier-card strong { font-size: .88rem; }
.tier-card p { margin: 10px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.tier-card[data-tier="S"] .tier-letter, .badge[data-tier="S"] { color: #d7c2ff; }
.tier-card[data-tier="A"] .tier-letter, .badge[data-tier="A"] { color: var(--green); }
.tier-card[data-tier="B"] .tier-letter, .badge[data-tier="B"] { color: #96d9b6; }
.tier-card[data-tier="C"] .tier-letter, .badge[data-tier="C"] { color: var(--accent); }
.tier-card[data-tier="D"] .tier-letter, .badge[data-tier="D"] { color: var(--amber); }
.tier-card[data-tier="E"] .tier-letter, .badge[data-tier="E"] { color: #f6a978; }
.tier-card[data-tier="F"] .tier-letter, .badge[data-tier="F"] { color: var(--red); }
.graphics-state .mode-card .tier-letter { width: 40px; font-size: .9rem; color: var(--accent); }
.physics-state .mode-card .tier-letter,
.network-state .mode-card .tier-letter,
.input-state .mode-card .tier-letter,
.window-state .mode-card .tier-letter { width: auto; padding: 0 10px; font-size: .9rem; color: var(--accent); }

.table-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #101724;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.search-wrap { position: relative; flex: 1 1 250px; }
.search-wrap::before {
  position: absolute;
  top: 50%;
  left: 13px;
  color: var(--muted);
  content: "⌕";
  font-size: 1.3rem;
  transform: translateY(-55%);
}

input, select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1420;
  color: var(--text);
  font: inherit;
}

input { width: 100%; padding: 8px 12px 8px 38px; }
select { padding: 8px 34px 8px 12px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.result-count { margin-left: auto; color: var(--muted); font-size: .88rem; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 14px 16px; vertical-align: top; }
th {
  background: #172235;
  color: #b6c6db;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

td { border-top: 1px solid #202c3e; }
tbody tr:hover { background: #151f2e; }
td:first-child { font-weight: 700; }
.emulator-state th { position: sticky; top: 0; }
.emulator-state td:first-child { width: 220px; min-width: 180px; }
.emulator-state td:nth-child(2) { width: 84px; }
.image-state td:first-child { min-width: 150px; }
.image-state td:nth-child(2) { width: 70px; }
.image-state td:nth-child(3) { min-width: 120px; }
.sound-state td:first-child { min-width: 175px; }
.sound-state td:nth-child(2) { width: 70px; }
.sound-state td:nth-child(3) { min-width: 110px; }
.sound-state td:nth-child(4) { min-width: 130px; }
.graphics-state th, .physics-state th, .window-state th, .network-state th, .input-state th { position: sticky; top: 0; }
.graphics-state td:first-child, .physics-state td:first-child, .window-state td:first-child, .network-state td:first-child, .input-state td:first-child { min-width: 100px; }
.graphics-state td:nth-child(2), .physics-state td:nth-child(2), .window-state td:nth-child(2), .network-state td:nth-child(2), .input-state td:nth-child(2) { width: 70px; }
.graphics-state td:nth-child(n+3):nth-child(-n+6) { min-width: 96px; font-size: .86rem; }
.physics-state td:nth-child(n+3):nth-child(-n+5),
.network-state td:nth-child(n+3):nth-child(-n+4),
.input-state td:nth-child(n+3):nth-child(-n+5),
.window-state td:nth-child(n+3):nth-child(-n+6) { min-width: 90px; font-size: .86rem; }
td:last-child { color: #c0ccdc; }
.badge { width: 34px; height: 30px; border-radius: 7px; background: #172235; }

.empty-state { padding: 32px; color: var(--muted); text-align: center; }
.emulator-state .empty-state,
.graphics-state .empty-state,
.physics-state .empty-state,
.window-state .empty-state,
.network-state .empty-state,
.input-state .empty-state { display: none; }

.footnote {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--muted);
}

.footnote p { margin: 0; }
.footnote p + p { margin-top: 8px; }
footer { padding: 20px 0 38px; color: #75859a; font-size: .82rem; }

@media (max-width: 850px) {
  .tier-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 1180px); }
  header { padding-top: 42px; }
  .tier-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  th, td { padding: 12px; }
  .emulator-state td:first-child { min-width: 160px; }
  .toolbar { align-items: stretch; }
  select { flex: 1 1 130px; }
  .result-count { flex-basis: 100%; margin-left: 0; }
}
