:root {
  --bg: #12161c; --panel: #1a2028; --line: #2b3440; --text: #e6eaf0; --muted: #8b97a7;
  --accent: #5ab0e8; --star: #f2b84b; --danger: #e5645a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 20px 32px; border-bottom: 1px solid var(--line); }
.top h1 { margin: 0; font-size: 22px; }
.auth { display: flex; gap: 12px; align-items: center; color: var(--muted); }
main { max-width: 1200px; margin: 0 auto; padding: 24px 32px 64px; }

input, select, textarea { background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 9px 11px; font: inherit; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 9px 14px; font: inherit; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0b1620; font-weight: 600; }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .6; cursor: wait; }

.add { display: flex; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.add input[type=url] { flex: 1 1 360px; }
#message { min-height: 24px; margin: 4px 0 12px; color: var(--muted); }
#message.error, .error { color: var(--danger); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th { text-align: left; font-weight: 600; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.game:last-of-type td, tr.reviews-row:last-child td { border-bottom: 0; }
tr.game:hover td { background: rgba(255,255,255,.02); }
td.thumb img { width: 120px; border-radius: 4px; display: block; }
.title { font-weight: 600; font-size: 16px; color: var(--text); text-decoration: none; }
.title:hover { color: var(--accent); }
.desc { margin: 4px 0 8px; color: var(--muted); max-width: 60ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { background: #243040; color: #b9d3ec; border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.stars { color: var(--star); letter-spacing: 2px; white-space: nowrap; }
.stars .off { color: var(--line); }
.avg { color: var(--muted); font-size: 13px; }
.row-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }

.reviews-row td { background: #151a21; padding: 20px 14px 24px 148px; }
.review { padding: 10px 0; border-bottom: 1px solid var(--line); max-width: 70ch; }
.review .who { font-weight: 600; margin-right: 8px; }
.review .when { color: var(--muted); font-size: 13px; }
.review p { margin: 4px 0 0; white-space: pre-wrap; }
.review-form { display: grid; gap: 10px; max-width: 460px; margin-top: 18px; }
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { font-size: 26px; color: var(--line); cursor: pointer; line-height: 1; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: var(--star); }
.star-input input:focus-visible + label { outline: 2px solid var(--accent); }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 24px; width: min(380px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h2 { margin: 0 0 16px; }
dialog label { display: grid; gap: 4px; margin-bottom: 12px; color: var(--muted); }
.actions { display: flex; justify-content: flex-end; gap: 10px; }
.empty { text-align: center; color: var(--muted); padding: 40px; }
@media (max-width: 700px) { .top, main { padding-left: 16px; padding-right: 16px; } .reviews-row td { padding-left: 14px; } }
