:root {
  color-scheme: dark;
  --bg: #0e0f12;
  --panel: #17191e;
  --panel-2: #1e2127;
  --line: #2a2e36;
  --text: #e9eaee;
  --muted: #9097a3;
  --accent: #e8833a;
  --accent-hover: #f39550;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(14, 15, 18, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 19px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.logo { width: 26px; height: 26px; flex: none; }

.search {
  margin-left: auto; width: min(320px, 100%);
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 16px; font: inherit; outline: none;
}
.search:focus { border-color: var(--accent); }

main { padding-top: 28px; padding-bottom: 60px; }

.status { color: var(--muted); margin: 0 0 20px; }
.status:empty { display: none; }

.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.game {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
}

.cover {
  aspect-ratio: 16 / 9; width: 100%; display: block;
  object-fit: cover; background: var(--panel-2);
}
.cover-empty {
  display: grid; place-items: center;
  font-size: 42px; font-weight: 800; color: #3a3f49;
  background: linear-gradient(135deg, #1c1f25, #14161a);
}

.game-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.game-title { margin: 0 0 2px; font-size: 18px; font-weight: 700; }
.game-count { margin: 0 0 12px; font-size: 13px; color: var(--muted); }

.mods { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.mod {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.mod-info { min-width: 0; flex: 1; }
.mod-name { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.mod-meta { margin: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #141414;
  font-weight: 700; font-size: 14px; text-decoration: none;
  padding: 9px 14px; border-radius: 8px;
  transition: background .15s;
}
.btn:hover { background: var(--accent-hover); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; }

.btn { border: 0; cursor: pointer; font-family: inherit; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); padding: 8px 11px; }
.btn-ghost:hover { background: var(--panel); border-color: #3a3f49; }
.mod-actions { flex: none; display: flex; gap: 6px; }

.no-mods { color: var(--muted); font-size: 14px; margin: 0; }

/* Janela de informações */
.info {
  width: min(600px, calc(100% - 32px)); max-height: min(85vh, 760px);
  padding: 0; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.info::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(2px); }
#info-body { padding: 22px 24px 24px; }
.info-close {
  position: sticky; top: 0; float: right; margin: 10px 10px 0 0;
  width: 34px; height: 34px; border-radius: 8px; border: 0;
  background: var(--panel-2); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer;
}
.info-close:hover { background: var(--line); }
.info-game { margin: 0; color: var(--accent); font-size: 13px; font-weight: 600; }
.info-title { margin: 2px 0 2px; font-size: 21px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.info-meta { margin: 0 0 16px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.info-desc { margin: 0 0 6px; }
.info h3 { margin: 18px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.info ul, .info ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.info li::marker { color: var(--accent); }
.info-download { margin-top: 22px; }
.tag {
  font-size: 11px; font-weight: 800; letter-spacing: .4px;
  padding: 2px 7px; border-radius: 6px; background: #5a1d1d; color: #ffb4b4;
}

@media (max-width: 560px) {
  .top-inner { height: auto; padding: 12px 16px; flex-wrap: wrap; }
  .search { width: 100%; margin-left: 0; }
  .grid { grid-template-columns: 1fr; }
  .mod { flex-wrap: wrap; }
  .mod-actions { width: 100%; justify-content: flex-end; }
  #info-body { padding: 18px 18px 20px; }
}
