@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #0b0a16;
  --panel: #171426;
  --panel-2: #1d1830;
  --line: #322a52;
  --text: #f1eefc;
  --text-dim: #a99fc9;
  --cyan: #00c0fe;
  --magenta: #fa19c8;
  --yellow: #fef903;
  --purple: #7b3ff0;
  --danger: #ff4d6d;
  --radius: 6px;
  --font-display: 'JetBrains Mono', ui-monospace, monospace;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
}

.logo {
  display: block;
  width: 220px;
  max-width: 80%;
  margin: 0 auto 14px;
  filter: drop-shadow(0 0 24px rgba(250, 25, 200, 0.25));
}
.logo-small {
  height: 34px;
  width: auto;
  display: block;
}

/* ---------- Login ---------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: min(320px, 90vw);
  padding: 36px 30px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.login-sub {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: 0 0 24px;
}
.login-card form { display: flex; flex-direction: column; gap: 10px; }
.login-card label {
  text-align: left;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.login-card input {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.95rem;
}
.login-card input:focus {
  outline: 2px solid var(--magenta);
  outline-offset: 1px;
}
.login-card button[type='submit'] {
  margin-top: 8px;
  background: var(--magenta);
  color: #1a0620;
  border: none;
  border-radius: var(--radius);
  padding: 11px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.login-card button[type='submit']:hover { filter: brightness(1.08); }
.error { color: var(--danger); font-size: 0.85rem; margin: 4px 0 0; }

/* ---------- App shell ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
}
.ghost-btn:hover { border-color: var(--magenta); color: var(--text); }

.layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: calc(100vh - 60px);
}
@media (max-width: 640px) {
  .layout { grid-template-columns: 1fr; }
  .system-rail { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); }
}

.system-rail {
  border-right: 1px solid var(--line);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.system-rail button {
  text-align: left;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: var(--text-dim);
  padding: 9px 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-size: 0.88rem;
  white-space: nowrap;
}
.system-rail button:hover { color: var(--text); background: var(--panel); }
.system-rail button.active {
  color: var(--magenta);
  border-left-color: var(--magenta);
  background: var(--panel);
}
.system-rail .count { color: var(--text-dim); font-size: 0.78rem; }

.library { padding: 22px; }
.library h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-dim);
  margin: 0 0 16px;
}
.empty-state { color: var(--text-dim); }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.game-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.game-card:hover { border-color: var(--cyan); }
.game-icon {
  width: 100%;
  height: 60px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--panel-2), #262b3a);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 0.75rem;
}
.game-title {
  font-size: 0.86rem;
  line-height: 1.3;
  text-transform: capitalize;
}

/* ---------- Player ---------- */
.player {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
 
.player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.game-container { flex: 1; }
.player[hidden] { display: none; }
