:root {
  --bg: #0e0d14; --panel: #17151f; --panel2: #1e1b29; --line: #2c2840; --text: #ece9f6; --muted: #9b95b3;
  --accent: #ff6b4a; --accent2: #ffb03a; --ok: #4fd18b; --bad: #ff6b7d;
  --mono: "Consolas", "Courier New", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 "Segoe UI", system-ui, sans-serif; min-height: 100vh; }
a { color: var(--accent2); }
.wrap { width: min(1100px, 100% - 32px); margin: 0 auto; padding: 22px 0 60px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand svg { width: 34px; height: 34px; }
.brand b { font: 800 19px/1 var(--mono); letter-spacing: .08em; }
.brand span { display: block; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 10px; padding: 9px 16px; cursor: pointer; text-decoration: none;
  background: var(--panel2); color: var(--text); font: 600 14px "Segoe UI", system-ui, sans-serif; box-shadow: inset 0 0 0 1px var(--line); }
.btn:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: none; }
.btn.primary:hover { background: #ff7f62; }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn.danger:hover { box-shadow: inset 0 0 0 1px var(--bad); color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; }
h1 { font: 800 30px/1.15 "Segoe UI", system-ui, sans-serif; margin: 0 0 6px; }
.muted { color: var(--muted); }
.search { width: 100%; max-width: 320px; padding: 10px 14px; border-radius: 10px; border: 0; background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); font: inherit; }
.toolbar { display: flex; justify-content: space-between; align-items: end; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }

/* game grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card { background: var(--panel); border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--accent), 0 10px 30px rgba(0,0,0,.35); }
.cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #2a2240, #1a1626); display: flex; align-items: center; justify-content: center; overflow: hidden; color: #4b4366; }
.cover img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.cover svg { width: 46px; height: 46px; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h2 { margin: 0; font-size: 17px; }
.card-body h2 a { color: var(--text); text-decoration: none; }
.card-body p { margin: 0; color: var(--muted); font-size: 13.5px; flex: 1; }
.meta { display: flex; gap: 10px; flex-wrap: wrap; font: 12px var(--mono); color: var(--muted); }
.card .btn { margin-top: 8px; justify-content: center; }
.grid .empty { grid-column: 1 / -1; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); background: var(--panel); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }

/* game page */
.game-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.game-head .cover { border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.desc { white-space: pre-wrap; color: #d6d2e6; margin: 14px 0 0; }
.versions { margin-top: 30px; display: grid; gap: 10px; }
.ver { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: var(--panel); padding: 14px 16px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.ver b { font-family: var(--mono); }
.ver .notes { flex-basis: 100%; white-space: pre-wrap; color: var(--muted); font-size: 13.5px; margin: 0; }
.tag { display: inline-block; font: 700 11px var(--mono); padding: 2px 7px; border-radius: 6px; background: rgba(255,107,74,.15); color: var(--accent); margin-left: 6px; }
@media (max-width: 760px) { .game-head { grid-template-columns: 1fr; } h1 { font-size: 25px; } }
footer.foot { margin-top: 50px; color: var(--muted); font-size: 12.5px; text-align: center; }

/* admin */
.panel { background: var(--panel); border-radius: 14px; padding: 18px; box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 18px; }
.panel h2 { margin: 0 0 12px; font-size: 18px; }
label.f { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
input[type=text], input[type=password], textarea, select { width: 100%; padding: 10px 12px; border-radius: 9px; border: 0; background: #0f0e16; color: var(--text); font: inherit; box-shadow: inset 0 0 0 1px var(--line); }
textarea { min-height: 110px; resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .two { grid-template-columns: 1fr; } }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; margin-top: 12px; }
.check input { margin-top: 3px; }
.msg { min-height: 20px; font-size: 13.5px; margin-top: 10px; }
.msg.ok { color: var(--ok); } .msg.err { color: var(--bad); } .msg.warn { color: var(--accent2); }
.status { padding: 10px 12px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line); }
.status.ok { box-shadow: inset 0 0 0 1px rgba(79,209,139,.5); } .status.warn { box-shadow: inset 0 0 0 1px rgba(255,176,58,.6); }
.game-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line); margin-top: 10px; }
.game-row .thumb { width: 84px; aspect-ratio: 16/9; border-radius: 7px; overflow: hidden; background: #241f35; flex: none; }
.game-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.game-row .info { flex: 1; min-width: 0; }
.game-row .info b { display: block; }
.pill { font: 700 11px var(--mono); padding: 2px 8px; border-radius: 99px; }
.pill.on { background: rgba(79,209,139,.15); color: var(--ok); } .pill.off { background: rgba(155,149,179,.15); color: var(--muted); }
.editor { margin-top: 10px; padding: 16px; border-radius: 12px; background: #13111b; box-shadow: inset 0 0 0 1px var(--line); }
.editor h3 { margin: 18px 0 4px; font-size: 15px; }
.editor h3:first-child { margin-top: 0; }
.vlist { display: grid; gap: 8px; margin-top: 8px; }
.vline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 11px; border-radius: 9px; background: var(--panel2); font-size: 13.5px; }
.vline .grow { flex: 1; min-width: 160px; }
.progress { height: 8px; border-radius: 6px; background: #0f0e16; overflow: hidden; margin-top: 10px; display: none; }
.progress.show { display: block; }
.progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .2s ease; }
.hidden { display: none !important; }
