:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #14181d;
  --panel-2: #1b2026;
  --line: #2a3139;
  --text: #f4f6f8;
  --muted: #98a2ad;
  --green: #63d69a;
  --yellow: #f1c75b;
  --red: #eb6a66;
  --blue: #68a8ff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; letter-spacing: 0; }

.topbar {
  min-height: 82px;
  padding: 16px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: #101318;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand h1 { margin: 0; font-size: 21px; line-height: 1.2; letter-spacing: 0; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.brand-mark { width: 42px; height: 42px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; flex: 0 0 auto; }
.brand-mark i { display: block; border-radius: 3px; }
.brand-mark i:nth-child(1) { background: var(--red); }
.brand-mark i:nth-child(2) { background: var(--yellow); }
.brand-mark i:nth-child(3) { background: var(--green); }
.brand-mark i:nth-child(4) { background: var(--blue); }
.live { color: #cbd2d9; font-size: 13px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.live span { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(99,214,154,.12); }

main { width: min(1420px, calc(100% - 36px)); margin: 0 auto; padding: 30px 0 54px; }
.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  overflow: hidden;
}
.summary div { padding: 20px 22px; border-right: 1px solid var(--line); }
.summary div:last-child { border-right: 0; }
.summary strong { display: block; font-size: 27px; line-height: 1; }
.summary span { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 700; }

.controls { display: grid; grid-template-columns: minmax(220px, 1fr) 220px auto; gap: 10px; margin: 24px 0 28px; }
.search { position: relative; }
.search span { position: absolute; width: 14px; height: 14px; border: 2px solid var(--muted); border-radius: 50%; left: 15px; top: 50%; transform: translateY(-57%); }
.search span::after { content: ""; position: absolute; width: 6px; height: 2px; background: var(--muted); right: -5px; bottom: -3px; transform: rotate(45deg); }
input, select {
  width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel); color: var(--text); outline: none;
}
input { padding: 0 14px 0 42px; }
select { padding: 0 34px 0 13px; }
input:focus, select:focus { border-color: #68737f; box-shadow: 0 0 0 3px rgba(104,115,127,.18); }
.segments { display: flex; border: 1px solid var(--line); background: var(--panel); border-radius: 6px; overflow: hidden; }
.segments button { min-height: 42px; padding: 0 14px; border: 0; border-right: 1px solid var(--line); color: var(--muted); background: transparent; cursor: pointer; }
.segments button:last-child { border-right: 0; }
.segments button.active { color: #0b0d10; background: var(--text); font-weight: 700; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 17px; }
.section-head span { color: var(--muted); font-size: 13px; }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.game-card { min-height: 150px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; overflow: hidden; display: grid; grid-template-columns: 104px minmax(0, 1fr); }
.cover { --accent: #68a8ff; position: relative; background: var(--accent); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(145deg, rgba(255,255,255,.22), transparent 43%, rgba(0,0,0,.35)); }
.cover::after { content: ""; position: absolute; width: 64px; height: 64px; border: 12px solid rgba(0,0,0,.15); border-radius: 50%; right: -30px; bottom: -22px; }
.cover span { position: relative; z-index: 1; color: rgba(0,0,0,.72); font-size: 15px; font-weight: 900; text-align: center; text-transform: uppercase; }
.cover b { position: absolute; left: 10px; top: 10px; width: 13px; height: 13px; border-radius: 50%; background: rgba(255,255,255,.8); box-shadow: 19px 0 rgba(255,255,255,.55); }
.game-copy { min-width: 0; padding: 14px 15px 13px; display: flex; flex-direction: column; }
.game-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.platform-tag { color: var(--accent, var(--blue)); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.game-top time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.game-copy h3 { margin: 9px 0 11px; font-size: 15px; line-height: 1.28; overflow-wrap: anywhere; }
.save-types { display: flex; flex-wrap: wrap; gap: 5px; }
.save-types span { padding: 4px 6px; border-radius: 4px; background: var(--panel-2); color: #c8d0d8; font-size: 10px; }
.game-meta { margin-top: auto; padding-top: 11px; display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.empty { padding: 70px 20px; text-align: center; border-top: 1px solid var(--line); color: var(--muted); }

@media (max-width: 980px) {
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls { grid-template-columns: minmax(200px, 1fr) 190px; }
  .segments { grid-column: 1 / -1; width: max-content; max-width: 100%; }
}
@media (max-width: 640px) {
  .topbar { align-items: flex-start; padding: 14px 18px; }
  .live { font-size: 0; margin-top: 9px; }
  main { width: min(100% - 24px, 540px); padding-top: 18px; }
  .summary { grid-template-columns: 1fr 1fr; }
  .summary div:nth-child(2) { border-right: 0; }
  .summary div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .summary div { padding: 16px; }
  .summary strong { font-size: 23px; }
  .controls { grid-template-columns: 1fr; margin: 16px 0 24px; }
  .segments { grid-column: auto; width: 100%; }
  .segments button { flex: 1; padding: 0 8px; font-size: 12px; }
  .game-grid { grid-template-columns: 1fr; }
  .game-card { grid-template-columns: 92px minmax(0, 1fr); min-height: 142px; }
}
