* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #0a0a0f;
  color: #e0e0e0;
  min-height: 100vh;
}
:root {
  --bg: #0a0a0f;
  --panel: #14141f;
  --panel2: #1c1c2a;
  --border: #2a2a3a;
  --accent: #4a9eff;
  --accent-hover: #3a8eef;
  --red: #e74c3c;
  --green: #2ecc71;
  --yellow: #f39c12;
  --muted: #6a6a7a;
  --text: #e0e0e0;
  --text-dim: #9a9aaa;
}
a { color: var(--accent); text-decoration: none; }
button {
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.15s;
}
button:hover { background: var(--border); }
button.primary { background: var(--accent); border-color: var(--accent); color: white; }
button.primary:hover { background: var(--accent-hover); }
button.danger { background: var(--red); border-color: var(--red); color: white; }
button.danger:hover { background: #c0392b; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
input, select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  width: 100%;
}
input:focus { outline: none; border-color: var(--accent); }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
tr:hover { background: var(--panel2); }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-logo {
  padding: 0 20px 24px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.sidebar-logo span { color: var(--accent); }
.nav-item {
  display: block;
  padding: 10px 20px;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.nav-item:hover { background: var(--panel2); color: var(--text); }
.nav-item.active { color: var(--accent); background: var(--panel2); border-left: 3px solid var(--accent); }
.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.main {
  flex: 1;
  padding: 32px;
  overflow-x: auto;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.page-title { font-size: 24px; font-weight: 700; }

/* Cards */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.stat-value { font-size: 32px; font-weight: 700; }
.stat-label { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.badge.green { background: rgba(46,204,113,0.15); color: var(--green); }
.badge.red { background: rgba(231,76,60,0.15); color: var(--red); }
.badge.yellow { background: rgba(243,156,18,0.15); color: var(--yellow); }
.badge.gray { background: rgba(106,106,122,0.2); color: var(--muted); }

/* Login */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 360px;
}
.login-card h1 { font-size: 22px; margin-bottom: 8px; }
.login-card p { color: var(--text-dim); margin-bottom: 20px; font-size: 14px; }
.login-card input { margin-bottom: 12px; }
.login-card button { width: 100%; padding: 12px; }
.login-error {
  color: var(--red);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
}

/* Search */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.search-bar select { width: 140px; flex-shrink: 0; }
.search-bar input { flex: 1; }

/* Player detail */
.player-header {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}
.player-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--panel2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.info-row .label { color: var(--text-dim); }
.info-row .value { font-family: monospace; }

/* Screenshots gallery */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.screenshot-item {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}
.screenshot-item img { width: 100%; height: 140px; object-fit: cover; display: block; }
.screenshot-item .meta {
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--panel2);
}
.screenshot-item .delete-btn {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(0,0,0,0.7);
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.15s;
}
.screenshot-item:hover .delete-btn { opacity: 1; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 480px;
  max-width: 90vw;
}
.modal h2 { margin-bottom: 16px; }
.modal label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 4px; }
.modal input, .modal select, .modal textarea { margin-bottom: 12px; }
.modal textarea { resize: vertical; min-height: 60px; font-family: inherit; }
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  cursor: zoom-out;
}
.lightbox img { max-width: 90vw; max-height: 90vh; }

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
}
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.steamid { font-family: monospace; font-size: 13px; }
.link-btn { color: var(--accent); cursor: pointer; text-decoration: underline; background: none; border: none; padding: 0; font: inherit; }
.link-btn:hover { color: var(--accent-hover); }

.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
